The Prophet ﷺ said: The imam is appointed only to be followed; when he says "Allah is most great," say "Allah is most great" and do not say "Allah is most great" until he says "Allah is most great." When he bows; bow; and do not bow until he bows. And when he says "Allah listens to him who praise Him," say "O Allah, our Lord, to Thee be the praise." The version recorded by Muslim goes: "And to Thee be the praise: And when he prostrate; and do not prostrate until he prostrates. When he prays standing, pray standing, and when he prays sitting, all of you pray sitting. Abu Dawud said: The words "O Allah, our Lord, to You be the praise" reported by Sulaiman were explained to me by some of our companions. (Using translation from Abū Dāʾūd 603)
قَالَ النَّبِيُّ صَلَّى اللهٌ عَلَيْهِ وَسَلَّمَ إِنَّمَا جُعِلَ الْإِمَامُ لِيُؤْتَمَّ بِهِ فَإِذَا كَبَّرَ فَكَبِّرُوا وَلَا تُكَبِّرُوا حَتَّى يُكَبِّرَ وَإِذَا رَكَعَ فَارْكَعُوا وَلَا تَرْكَعُوا حَتَّى يَرْكَعَ وَإِذَا قَالَ سَمِعَ اللهُ لِمَنْ حَمِدَهُ فَقُولُوا اللهُمَّ رَبَّنَا لَكَ الْحَمْدُ قَالَ مُسْلِمٌ وَلَكَ الْحَمْدُ وَإِذَا سَجَدَ فَاسْجُدُوا وَلَا تَسْجُدُوا حَتَّى يَسْجُدَ وَإِذَا صَلَّى قَائِمًا فَصَلُّوا قِيَامًا وَإِذَا صَلَّى قَاعِدًا فَصَلُّوا قُعُودًا أَجْمَعِينَ قَالَ أَبُو دَاوُدَ اللهُمَّ رَبَّنَا لَكَ الْحَمْدُ أَفْهَمَنِي بَعْضُ أَصْحَابِنَا عَنْ سُلَيْمَانَ