Sahih Muslim 932
The Book of Prayers
حَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ، وَابْنُ، خَشْرَمٍ قَالاَ أَخْبَرَنَا عِيسَى بْنُ يُونُسَ، حَدَّثَنَا الأَعْمَشُ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يُعَلِّمُنَا يَقُولُ " لاَ تُبَادِرُوا الإِمَامَ إِذَا كَبَّرَ فَكَبِّرُوا وَإِذَا قَالَ وَلاَ الضَّالِّينَ . فَقُولُوا آمِينَ . وَإِذَا رَكَعَ فَارْكَعُوا وَإِذَا قَالَ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ . فَقُولُوا اللَّهُمَّ رَبَّنَا لَكَ الْحَمْدُ " .
Abu Huraira reported: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
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.