Anas bin Malik reported,

The Messenger of Allah ﷺ rode a horse and was thrown from it, injuring his right side. He prayed one of the prayers seated, so we prayed behind him seated as well. When he finished, he said, "The imam is appointed only to be followed. When he prays standing, pray standing. When he bows, bow. When he rises, rise. When he says, 'Allah hears whoever praises Him,' say, 'Our Lord, to You belongs all praise.' When he prays standing, pray standing, and when he prays sitting, all of you pray sitting."Abu Abdullah said that Humaydi said, "His statement, 'When he prays sitting, pray sitting,' refers to his earlier illness. Later on, the Prophet ﷺ prayed sitting while the people behind him stood, and he did not order them to sit. What is to be followed is the latest, then the latest, of the Prophet's ﷺ practice."

Bukhari 689

Sahih

حدثنا عبد الله بن يوسف قال أخبرنا مالك عن ابن شهاب

عن أنس بن مالك

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

البخاري 689صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Adhan
Chapter
Imam is appointed to be followed
Numbering
Darussalam 689
Bukhari 689