He reported that the Messenger of Allah ﷺ fell from a horse and was injured, so he led us in prayer while seated, and we prayed behind him seated as well. When he finished, he said, "The imam, or rather, the imam has been appointed only to be followed. So when he says the takbir, say the takbir. 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 prostrates, prostrate. And when he prays seated, all of you pray seated."
حدثنا قتيبة حدثنا الليث عن ابن شهاب
أنه قال خر رسول الله ﷺ عن فرس فجحش فصلى بنا قاعدا فصلينا معه قعودا ثم انصرف فقال إنما الإمام أو إنما جعل الإمام ليؤتم به فإذا كبر فكبروا وإذا ركع فاركعوا وإذا رفع فارفعوا وإذا قال سمع الله لمن حمده فقولوا ربنا ولك الحمد وإذا سجد فاسجدوا وإذا صلى قاعدا فصلوا قعودا أجمعون
Agreed upon. Muslim also recorded it in the Book of Prayer, chapter "The follower's imitation of the imam," hadith no. 411, from Qutayba, and Bukhari, hadith no. 689, from the hadith of Ibn Shihab Zuhri, with the same wording.On this subject there are also narrations from Ayesha [Bukhari, no. 688, Muslim, no. 412], Abu Hurairah [Bukhari, no. 722, and Muslim, no. 414], Jabir [Muslim, no. 413], Ibn Umar [Ahmad, 2/93], and Muawiya [Tabarani in Al-Kabir, 33/19, no. 764].