Anas bin Malik reported,

We set out with the Prophet ﷺ from Medina to Mecca, and he prayed two rakahs at a time until we returned to Medina.I asked, "Did you stay in Mecca for any length of time?"He replied, "We stayed there for ten days."

Bukhari 1081

Sahih

حدثنا أبو معمر قال حدثنا عبد الوارث قال حدثنا يحيى بن أبي إسحاق قال سمعت

أنسا يقول

خرجنا مع النبي ﷺ من المدينة إلى مكة فكان يصلي ركعتين ركعتين حتى رجعنا إلى المدينة قلت أقمتم بمكة شيئا قال أقمنا بها عشرا

البخاري 1081صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Shortening
Chapter
Shortening the prayer and how long one stays until he shortens
Numbering
Darussalam 1081
Bukhari 1081