The prayer were two rakahs before
The first thing that was ordained upon the Messenger of Allah ﷺ was the prayer, two rakahs, two rakahs, except Maghrib, which was three rakahs. Then Allah completed Zuhr, Asr, Isha in fours while one is resident, and He made the prayer obligatory as it was initially obligated ˹as two units only˺ during travel.
كَانَ أَوَّلَ مَا افْتُرِضَ عَلَى رَسُولِ اللهِ ﷺ الصَّلَاةُ رَكْعَتَانِ رَكْعَتَانِ إِلَّا الْمَغْرِبَ فَإِنَّهَا كَانَتْ ثَلَاثًا ثُمَّ أَتَمَّ اللهُ الظُّهْرَ وَالْعَصْرَ وَالْعِشَاءَ الْآخِرَةَ أَرْبَعًا فِي الْحَضَرِ وَأَقَرَّ الصَّلَاةَ عَلَى فَرْضِهَا الْأَوَّلِ فِي السَّفَرِ