(Imām Bukhārī narrates): Qutaibah ibn Sa'īd narrated to us, he said: Laith narrated to us, from Ibn Shihāb, from Anas ibn Mālik, may Allāh be pleased with him, he narrated that:
the Messenger of Allāh ﷺ fell from a horse, so he was injured. Then he led us in prayer sitting, and we too prayed with him sitting. Then after finishing the prayer, he said that the imām is appointed only so that he may be followed; so when he pronounces the takbīr, you pronounce the takbīr; and when he performs rukū', you perform rukū'; and when he raises his head from rukū', you raise your head from rukū'; and when he says "Sami'a Allāhu liman hamidah", you say "Rabbanā laka al-hamd"; and when he performs sajdah, you perform sajdah.
حَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، قَالَ حَدَّثَنَا لَيْثٌ، عَنِ ابْنِ شِهَابٍ، عَنْ أَنَسِ بْنِ مَالِكٍ، أَنَّهُ قَالَ خَرَّ رَسُولُ اللَّهِ صلى الله عليه وسلم عَنْ فَرَسٍ فَجُحِشَ فَصَلَّى لَنَا قَاعِدًا فَصَلَّيْنَا مَعَهُ قُعُودًا، ثُمَّ انْصَرَفَ فَقَالَ " إِنَّمَا الإِمَامُ ـ أَوْ إِنَّمَا جُعِلَ الإِمَامُ ـ لِيُؤْتَمَّ بِهِ، فَإِذَا كَبَّرَ فَكَبِّرُوا، وَإِذَا رَكَعَ فَارْكَعُوا، وَإِذَا رَفَعَ فَارْفَعُوا، وَإِذَا قَالَ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ. فَقُولُوا رَبَّنَا لَكَ الْحَمْدُ. وَإِذَا سَجَدَ فَاسْجُدُوا ".
Reference: Sahih Al Bukhari 733