The Messenger of Allah ﷺ used to teach us, saying, "Do not get ahead of the imam. When he says the takbir, say the takbir. When he says, 'nor of those who go astray' [Fatihah 1:7], say, 'Ameen.' When he bows, bow with him. And when he says, 'Allah hears whoever praises Him,' say, 'O Allah, our Lord, to You belongs all praise.'"
كان رسول الله ﷺ يعلمنا يقول: لا تبادروا الإمام، إذا كبر فكبروا، وإذا قال: {ولا الضالين} فقولوا: آمين، وإذا ركع فاركعوا، وإذا قال: سمع الله لمن حمده، فقولوا: اللهم ربنا لك الحمد.
Muslim narrated it in "The Prayer" (415) via Amash, from Abu Salih, from Abu Hurairah, as mentioned. He also narrated it via Suhayl bin Abu Salih, from his father, from Abu Hurairah, in similar fashion, except for the phrase, "nor those who have gone astray" say Ameen, and he added, "and do not raise it before him."