Anas bin Malik reported,

One night, the companions came to the Messenger of Allah ﷺ. He came out and led them in a short prayer, then entered his house and prolonged his prayer there. Then he came out again and led them in a short prayer, then entered his house and prolonged his prayer there.In the morning, they said, "Messenger of Allah, you prayed, lengthening your prayer when you went inside and shortening it when you came out."He replied, "I did what I did for your sake."

Ahmad 14102

Sahih

حدثنا بهز حدثنا حماد قال أخبرنا ثمامة بن عبد الله بن أنس

عن أنس بن مالك

أن رسول الله ﷺ جاءه أصحابه ذات ليلة فخرج فصلى بهم فخفف ثم دخل بيته فأطال ثم خرج فصلى بهم فخفف ثم دخل بيته فأطال فلما أصبح قالوا يا رسول الله صليت فجعلت تطيل إذا دخلت وتخفف إذا خرجت قال من أجلكم فعلت ما فعلت

أحمد 14102صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Anas bin Malik
Numbering
Darussalam 14102
Ahmad 14102