The Messenger of Allah ﷺ once rode a horse and was thrown from it, scraping his right side. He prayed one of the prayers sitting down, and we prayed behind him sitting 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 the one who praises Him,' say, 'Our Lord, to You belongs all praise.' And when he prays sitting, then all of you pray sitting."
حدثني يحيى عن مالك عن ابن شهاب
أن رسول الله ﷺ ركب فرسا فصرع فجحش شقه الأيمن فصلى صلاة من الصلوات وهو قاعد وصلينا وراءه قعودا فلما انصرف قال إنما جعل الإمام ليؤتم به فإذا صلى قائما فصلوا قياما وإذا ركع فاركعوا وإذا رفع فارفعوا وإذا قال سمع الله لمن حمده فقولوا ربنا ولك الحمد وإذا صلى جالسا فصلوا جلوسا أجمعون