Sayyiduna Abu Hurayrah (may Allah be pleased with him) narrates that the Prophet (peace and blessings be upon him) said: "The imam is appointed only to be followed. When he says the takbir, you say the takbir too, and do not say 'Allahu akbar' (Allah is the Greatest) until he has said it. When he bows, you bow too, and do not bow until he bows. When he says 'Sami'a Allahu liman hamidah' (Allah hears the one who praises Him), you say 'Allahumma rabbana laka al-hamd' (O Allah, our Lord, to You belongs all praise); in Muslim's wording: 'wa laka al-hamd' (and to You belongs all praise). When he prostrates, you prostrate too, and do not prostrate until he has prostrated. When he prays standing, you pray standing too, and when he prays sitting, all of you pray sitting."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5144