"Urwah told me that 'Aishah said: 'Allah enjoined the salah upon the Messenger of Allah ﷺ, and the first thing that He enjoined was two Rak'ahs at a time, then it was made complete four Rak'ahs while in the state of residence but the prayer when traveling remained two Rak'ahs, as it was first enjoined.'"
عَنْ صَلاَةِ رَسُولِ اللَّهِ ﷺ بِمَكَّةَ قَبْلَ الْهِجْرَةِ إِلَى الْمَدِينَةِ قَالَ أَخْبَرَنِي عُرْوَةُ عَنْ عَائِشَةَ قَالَتْ فَرَضَ اللَّهُ ﷻ الصَّلاَةَ عَلَى رَسُولِهِ ﷺ أَوَّلَ مَا فَرَضَهَا رَكْعَتَيْنِ رَكْعَتَيْنِ ثُمَّ أُتِمَّتْ فِي الْحَضَرِ أَرْبَعًا وَأُقِرَّتْ صَلاَةُ السَّفَرِ عَلَى الْفَرِيضَةِ الأُولَى