Ayesha reported,

Some people came to visit him during his illness, so he led them in prayer while sitting. They began to pray standing, but he gestured to them to sit down. When he finished, he said, "The imam is appointed to be followed. When he bows, you bow. When he rises, you rise. And if he prays sitting, then pray sitting."Abu Abdullah said, Humaydi said, "This hadith has been abrogated, because the last prayer the Prophet ﷺ performed, he prayed sitting while the people behind him stood."

Bukhari 5658

Sahih

حدثنا محمد بن المثنى حدثنا يحيى حدثنا هشام قال أخبرني أبي

عن عائشة رضي الله عنها أن النبي ﷺ

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

البخاري 5658صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Sick
Chapter
If one visits a sick person and the prayer time comes, so he leads them in congregational prayer
Numbering
Darussalam 5658
Bukhari 5658