It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "The imam is appointed only to be followed. So when he says the takbir, say the takbir; when he bows, bow; when he raises his head (from bowing), raise your heads; when he says 'Sami'allahu liman hamidah' (Allah has heard the one who praised Him), all of you together say 'Allahumma rabbana lakal-hamd' (O Allah, our Lord, to You belongs all praise); when he prostrates, prostrate, and do not prostrate before he prostrates; and when he raises his head (from prostration), raise your heads, and do not raise your heads before he raises his."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2594