It is narrated from Anas bin Malik (may Allah be pleased with him) that the Messenger of Allah (ﷺ) mounted a horse and fell from it, injuring his right side. He (ﷺ) led a prayer sitting, so we also prayed sitting behind him. When he (ﷺ) finished, he said: "The Imam is appointed to be followed, so when he prays standing, you should also pray standing, and when he bows, you should also bow, and when he raises his head from bowing, you should also raise your heads, and when he says ﴿Sami' Allahu liman hamidah﴾, you should say ﴿Rabbana wa laka al-hamd﴾, and when he prays sitting, you should all pray sitting."
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 306
Hadith Takhrijاخرجہ البخاری، الاذان، باب انما جعل الامام لیؤتم بہ: 689، ومسلم، الصلاة، باب ائتمام المأموم بالامام: 411۔