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