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.' And if he prays sitting, then pray sitting, all of you."
حدثنا محمد بن جعفر قال حدثنا محمد بن عمرو عن أبي سلمة
قال رسول الله ﷺ إنما الإمام ليؤتم به فإذا كبر فكبروا وإذا ركع فاركعوا وإذا قال سمع الله لمن حمده فقولوا ربنا لك الحمد وإن صلى جالسا فصلوا جلوسا أجمعون
Its isnad is sahih. It was previously mentioned at 2/376.