Anas bin Malik reported,

One night, the companions of the Messenger of Allah ﷺ came to him. He went out and led them in a brief prayer, then entered his house and prayed at length. He came out again and led them in a brief prayer, then went back into his house and prayed at length.In the morning, they said, "Messenger of Allah, you prayed, but you would prolong the prayer when you entered your house and shorten it when you came out to us."He replied, "I did that for your sake."

Ahmad 12918

Sahih

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

عن أنس بن مالك

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

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