It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "The imam is appointed only to be followed, so do not differ with him. When the imam says the takbir, say the takbir; when he recites, be silent; when the imam says "Not of those who have incurred wrath, nor of those who are astray" [Surah al-Fatihah: 7], say Amin; when he bows, you too bow; when the imam says 'Sami'allahu liman hamidah' (Allah hears the one who praises Him), say 'Allahumma rabbana lakal-hamd' (O Allah, our Lord, to You belongs all praise); when he prostrates, prostrate; and when he leads the prayer sitting, all of you pray sitting."
In the narration of Ibn Ajlan it says: "When he recites, remain silent."
This is an error (wahm) on the part of Ibn Ajlan. Yahya bin Ma'in said about the words "When he recites, remain silent" in the hadith of Ibn Ajlan: It is nothing. Abu Hatim said: This phrase is not preserved; it is among the confusions of Ibn Ajlan. Kharijah bin Mus'ab also narrated it, and Kharijah too is not strong. Yahya bin al-Ala al-Razi also narrated it as they did, and Yahya bin al-Ala is matruk (abandoned).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2891