The Messenger of Allah ﷺ fell ill, and some of his companions came to visit him. The Prophet ﷺ prayed while sitting, and they prayed behind him standing. He gestured to them to sit down.When he finished, he said, "The imam is appointed only to be followed. When he bows, bow. When he rises, rise. And when he prays sitting, pray sitting."
حدثنا أبو بكر بن أبي شيبة حدثنا عبدة بن سليمان عن هشام بن عروة عن أبيه
اشتكى رسول الله ﷺ فدخل عليه ناس من أصحابه يعودونه فصلى النبي ﷺ جالسا فصلوا بصلاته قياما فأشار إليهم أن اجلسوا فلما انصرف قال إنما جعل الإمام ليؤتم به فإذا ركع فاركعوا وإذا رفع فارفعوا وإذا صلى جالسا فصلوا جلوسا
Bukhari narrated it in the Book of Adhan, Chapter "The Imam Is Appointed Only to Be Followed," h: 688, 1113, 1236, 5658, from the hadith of Hisham. Muslim narrated it in the Book of Prayer, Chapter "The Follower's Following of the Imam," h: 412, from Abu Bakr bin Abu Shayba, with the same wording.