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 for us to sit, and we performed the prayer with him while seated.When he gave the closing salam, he said, "You were about to do just now what the Persians and Romans do. They stand before their kings while the kings remain seated. Do not do this. Follow your imams. If he prays standing, then pray standing. If he prays seated, then pray seated."
اشتكى رسول الله ﷺ فصلينا وراءه وهو قاعد، وأبو بكر يسمع الناس تكبيره. فالتفت إلينا فرآنا قياما، فأشار إلينا فقعدنا، فصلينا بصلاته قعودا، فلما سلم قال: إن كدتم آنفا لتفعلون فعل فارس والروم، يقومون على ملوكهم وهم قعود فلا تفعلوا، ائتموا بأئمتكم، إن صلى قائما فصلوا قياما، وإن صلى قاعدا فصلوا قعودا.
Muslim narrated it in the Book of Prayer (413) via Layth, from Abu Zubayr, from Jabir bin Abdullah, as mentioned above.In Sunan Abu Dawud (602), it is narrated from Abu Sufyan, from Jabir, who said, "The Messenger of Allah ﷺ rode a horse in Madinah and it threw him against the trunk of a palm tree, dislocating his foot. We came to visit him and found him in Ayesha's upper room, performing prayer while sitting, so we stood behind him." He then related the hadith.