I asked Anas bin Malik about shortening the prayer.He said, "I used to travel to Kufa and pray two rakahs until I returned."Anas also said, "Whenever the Messenger of Allah ﷺ went out on a journey of three miles or three farsakhs," Shuba was the one uncertain which, "he would pray two rakahs."
حدثنا محمد بن جعفر حدثنا شعبة
سألت أنس بن مالك عن قصر الصلاة قال كنت أخرج إلى الكوفة فأصلي ركعتين حتى أرجع وقال أنس كان رسول الله ﷺ إذا خرج مسيرة ثلاثة أميال أو ثلاثة فراسخ شعبة الشاك صلى ركعتين