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".
كَانَ رَسُولُ اللَّهِ ﷺ يُعَلِّمُنَا يَقُولُ لاَ تُبَادِرُوا الإِمَامَ إِذَا كَبَّرَ فَكَبِّرُوا وَإِذَا قَالَ وَلاَ الضَّالِّينَ فَقُولُوا آمِينَ وَإِذَا رَكَعَ فَارْكَعُوا وَإِذَا قَالَ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ فَقُولُوا اللَّهُمَّ رَبَّنَا لَكَ الْحَمْدُ