Ayesha reported,

The Messenger of Allah ﷺ fell ill, and some of his companions came in to visit him. The Messenger of Allah ﷺ prayed while sitting, and they prayed behind him standing. He gestured to them to sit down, so they sat. When he finished, he said, "The imam is appointed only to be followed. When he bows, bow. When he rises, rise. When he prays sitting, pray sitting."

Muslim 926

Sahih

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

عن عائشة قالت

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

مسلم 926صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Prayer
Chapter
Following the imam by the one praying behind him
Numbering
Darussalam 926
Muslim 926