The Messenger of Allah ﷺ prayed two units when he traveled and four units when he was resident.Ibn Abbas said, "Whoever prays four units while traveling is like one who prays two units while resident."Ibn Abbas also said, "The prayer was only shortened on one occasion, when the Messenger of Allah ﷺ prayed two units and the people prayed one unit each."
حدثنا مروان بن معاوية الفزاري حدثنا حميد بن علي العقيلي حدثنا الضحاك بن مزاحم
صلى رسول الله ﷺ حين سافر ركعتين وحين أقام أربعا قال قال ابن عباس فمن صلى في السفر أربعا كمن صلى في الحضر ركعتين قال وقال ابن عباس لم تقصر الصلاة إلا مرة حيث صلى رسول الله ﷺ ركعتين وصلى الناس ركعة ركعة