The Prophet (ﷺ) said, "The Imam is to be followed. Say the Takbir when he says it; bow if he bows; if he says 'Sami`a l-lahu liman hamidah', say, ' Rabbana wa laka l-hamd', prostrate if he prostrates and pray sitting altogether if he prays sitting."
Reference: Sahih al-Bukhari 734 In-book : Book 10, Hadith 128 USC-MSA web (English) : Vol. 1, Book 12, Hadith 701 (deprecated)
Help us gift a modern, ad-free Islamic application for the Muslim Ummah. Your donation will be recorded as Sadaqah Jariyah in your book of deeds, In Sha Allah.