Sunan Ibn Majah, Book 5, Hadith 1297 (In-Book) ⓘ
It was narrated that Abu Hurairah said: “The Messenger of Allah said: ‘The Imam is appointed to be followed. When he says Allahu Akbar, then say Allahu Akbar; when he bows, then bow; when he says Sami’ Allahu liman hamidah, then say Rabbana wa lakal-hamd; when he prostrates then prostrate; if he prays standing, then pray standing, and if he prays sitting down then pray sitting down.”
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا هُشَيْمُ بْنُ بَشِيرٍ، عَنْ عُمَرَ بْنِ أَبِي سَلَمَةَ، عَنْ أَبِيهِ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ " إِنَّمَا جُعِلَ الإِمَامُ لِيُؤْتَمَّ بِهِ فَإِذَا كَبَّرَ فَكَبِّرُوا وَإِذَا رَكَعَ فَارْكَعُوا وَإِذَا قَالَ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ فَقُولُوا رَبَّنَا وَلَكَ الْحَمْدُ وَإِنْ صَلَّى قَائِمًا فَصَلُّوا قِيَامًا وَإِنْ صَلَّى قَاعِدًا فَصَلُّوا قُعُودًا " .
also referenced under: Hadith 1239 (Reference) & Volume 2, Book 5, Hadith 1239 (DarusSalam)