A'isha, the wife of the Messenger of Allah (ﷺ), said Allah prescribed the prayer as two rak'ahs, then it was completed (to four rak'ahs) at the place of residence, but was retained in the same position in journey as it was first made obligatory.
Reference: Sahih Muslim 685 b In-book : Book 6, Hadith 2 USC-MSA web (English) : Book 4, Hadith 1459 (deprecated)
Help us gift a modern, ad-free Islamic application for the Muslim Ummah. Your donation will be recorded as Sadaqah Jariyah in your book of deeds, In Sha Allah.