I went on an expedition with the Messenger of Allah ﷺ, and I was present with him at the conquest. He stayed eighteen days in Mecca and prayed only two rak'ahs (at each time of prayer). And he said: You who live in the town must pray four; we are travellers. (Using translation from Abū Dāʾūd 1229)
غَزَوْتُ مَعَ النَّبِيِّ ﷺ وَشَهِدْتُ مَعَهُ الْفَتْحَ فَأَقَامَ بِمَكَّةَ ثَمَانِ عَشْرَةَ لَيْلَةً لَا يُصَلِّي إِلَّا رَكْعَتَيْنِ يَقُولُ يَا أَهْلَ الْبَلَدِ صَلُّوا أَرْبَعًا فَإِنَّا سَفْرٌ وَرُوِّينَا قَبْلَ هَذَا فِي الْحَدِيثِ عَنْ أَبِي بَكْرٍ وَعُمَرَ مِثْلُ ذَلِكَ