We set out with the Messenger of Allah ﷺ from Medina to Mecca, and he kept praying two rakahs until we returned to Medina.We asked, "Did you stay there for any length of time?"He replied, "We stayed there ten days."
حدثنا موسى بن إسمعيل ومسلم بن إبراهيم المعنى قالا حدثنا وهيب حدثني يحيى بن أبي إسحق
خرجنا مع رسول الله ﷺ من المدينة إلى مكة فكان يصلي ركعتين حتى رجعنا إلى المدينة فقلنا هل أقمتم بها شيئا قال أقمنا بها عشرا
Bukhari, "Shortening the Prayer," the chapter on what has been said about shortening the prayer and how long one may stay before shortening it, no. 1081, and Muslim, "Prayer of the Traveler," the chapter on the prayer of travelers and shortening it, no. 693, from the hadith of Yahya bin Abu Ishaq, through this same route.