Sahih Muslim Book 4, Hadith 93
A hadith like this has been transmitted by Hammam b. Munabbih from the Messenger of Allah (ﷺ) on the authority of Abu Huraira.
The Messenger of Allah (ﷺ) said: The Imam is appointed, so that he should be followed, so don't be at variance with him. Recite takbir when he recites it; bow down when he bows down and when he says:" Allah listens to him who praises Him," say:" O Allah, our Lord, to Thee be the Praise." And when he (the Imam) prostrates, you should also prostrate, and when he says prayer sitting, you should all observe prayer sitting.
The Messenger of Allah (ﷺ) while teaching us (the principles of faith), said: Do not try to go ahead of the Imam, recite takbir when he recites it, and when he says: "Nor of those who err" you should say Amin, bow down when he bows down, and when he says: "Allah listens to him who praises Him" say: "O Allah, our Lord, to Thee be the praise".