Yahya related to me from Malik from Ibn Shihab from Anas ibn Malik that the Messenger of Allah ﷺ fell off his horse when riding, and his right side was scraped, so he did one of the prayers sitting, and we prayed behind him sitting. When he left, he said, "The imam is appointed to be followed. If he prays standing, then pray standing, and when he goes into ruku, go into ruku, and when he rises, rise, and when he says, 'Allah hears whoever praises him,' say, 'Our Lord, praise belongs to You,' and if he prays sitting, then all of you pray sitting."
أَنَّ رَسُولَ اللَّهِ ﷺ رَكِبَ فَرَسًا فَصُرِعَ فَجُحِشَ شِقُّهُ الأَيْمَنُ فَصَلَّى صَلاَةً مِنَ الصَّلَوَاتِ وَهُوَ قَاعِدٌ وَصَلَّيْنَا وَرَاءَهُ قُعُودًا فَلَمَّا انْصَرَفَ قَالَ إِنَّمَا جُعِلَ الإِمَامُ لِيُؤْتَمَّ بِهِ فَإِذَا صَلَّى قَائِمًا فَصَلُّوا قِيَامًا وَإِذَا رَكَعَ فَارْكَعُوا وَإِذَا رَفَعَ فَارْفَعُوا وَإِذَا قَالَ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ فَقُولُوا رَبَّنَا وَلَكَ الْحَمْدُ وَإِذَا صَلَّى جَالِسًا فَصَلُّوا جُلُوسًا أَجْمَعُونَ