the mother of believers: Allah enjoined the prayer when He enjoined it, it was two rakʿat only (in every prayer) both when in residence or on journey. Then the prayers offered on journey remained the same, but (the rakʿat of) the prayers for non-travelers were increased.
فَرَضَ اللَّهُ الصَّلاَةَ حِينَ فَرَضَهَا رَكْعَتَيْنِ رَكْعَتَيْنِ فِي الْحَضَرِ وَالسَّفَرِ فَأُقِرَّتْ صَلاَةُ السَّفَرِ وَزِيدَ فِي صَلاَةِ الْحَضَرِ