[Machine] The Messenger of Allah ﷺ prayed two units when he traveled and four units when he stayed. Ibn Abbas said, "Whoever prays four units of prayer while traveling is like one who prays two units while in a settled residence." He also said, "The prayer is not shortened except once, as the Messenger of Allah ﷺ prayed two units and the people prayed one unit each."
صَلَّى رَسُولُ اللهِ ﷺ حِينَ سَافَرَ رَكْعَتَيْنِ وَحِينَ أَقَامَ أَرْبَعًا قَالَ قَالَ ابْنُ عَبَّاسٍ فَمَنْ صَلَّى فِي السَّفَرِ أَرْبَعًا كَمَنْ صَلَّى فِي الْحَضَرِ رَكْعَتَيْنِ قَالَ وَقَالَ ابْنُ عَبَّاسٍ لَمْ تُقْصَرِ الصَّلاةُ إِلَّا مَرَّةً وَاحِدَةً حَيْثُ صَلَّى رَسُولُ اللهِ ﷺ رَكْعَتَيْنِ وَصَلَّى النَّاسُ رَكْعَةً رَكْعَةً