“The Imam is appointed to be followed. When he says Allahu Akbar, then say Allahu Akbar; when he bows, then bow; when he says Sami’ Allahu liman hamidah, then say Rabbana wa lakal-hamd; when he prostrates then prostrate; and if he prays sitting down then pray sitting down.”
Sunan Ibn Majah Book 5, Hadith 436