Jabir bin Abdullah reported,

The Messenger of Allah ﷺ fell ill, so we prayed behind him while he was seated, and Abu Bakr was relaying his takbir to the people. He turned toward us and saw us standing, so he gestured to us, and we sat down and prayed his prayer seated.When he finished with the salam, he said, "You were just about to do what the Persians and Romans do. They stand before their kings while their kings remain seated. Do not do that. Follow your imams. If he prays standing, then pray standing, and if he prays seated, then pray seated."

Muslim 928

Sahih

حدثنا قتيبة بن سعيد حدثنا ليث ح و حدثنا محمد بن رمح أخبرنا الليث عن أبي الزبير

عن جابر قال

اشتكى رسول الله ﷺ فصلينا وراءه وهو قاعد وأبو بكر يسمع الناس تكبيره فالتفت إلينا فرآنا قياما فأشار إلينا فقعدنا فصلينا بصلاته قعودا فلما سلم قال إن كدتم آنفا لتفعلون فعل فارس والروم يقومون على ملوكهم وهم قعود فلا تفعلوا ائتموا بأئمتكم إن صلى قائما فصلوا قياما وإن صلى قاعدا فصلوا قعودا

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