Abu Hurairah reported,

The Messenger of Allah ﷺ said, "The imam is appointed only to be followed. When he says the takbir, say the takbir. When he bows, bow. When he says, 'Allah hears whoever praises Him,' say, 'Our Lord, to You belongs all praise.' If he prays standing, pray standing, and if he prays sitting, pray sitting."

Ibn Majah 1239

Sahih

حدثنا أبو بكر بن أبي شيبة حدثنا هشيم بن بشير عن عمر بن أبي سلمة عن أبيه

عن أبي هريرة قال

قال رسول الله ﷺ إنما جعل الإمام ليؤتم به فإذا كبر فكبروا وإذا ركع فاركعوا وإذا قال سمع الله لمن حمده فقولوا ربنا ولك الحمد وإن صلى قائما فصلوا قياما وإن صلى قاعدا فصلوا قعودا

ابن ماجه 1239صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Establishing prayer and the sunnah regarding it
Chapter
Imam is appointed to be followed
Numbering
Darussalam 1239
Ibn Majah 1239