(Imām Bukhārī narrates): 'Abdullāh ibn Muhammad narrated to us, he said: 'Abdur-Razzāq narrated to us, he said: Ma'mar informed us, from Hammām, from Abū Hurairah, may Allāh be pleased with him, from the Prophet ﷺ, he said:
The imām is appointed only so that he may be followed, so do not differ from him; so when he performs rukū', you perform rukū'; and when he says "Sami'a Allāhu liman hamidah", you say "Rabbanā laka al-hamd"; and when he performs sajdah, you perform sajdah; and when he prays sitting, all of you pray sitting. Keep the row straight in prayer, because keeping the row straight is part of the excellence of the prayer.
Reference: Sahih Al Bukhari 722