She reported that the Messenger of Allah ﷺ prayed in his house while seated, and a group of people prayed behind him standing. He gestured to them to sit down. When he finished, he said, "The imam is appointed only to be followed. When he bows, bow. When he rises, rise. And when he prays seated, pray seated."
حدثنا القعنبي عن مالك عن هشام بن عروة عن أبيه
أنها قالت صلى رسول الله ﷺ في بيته وهو جالس فصلى وراءه قوم قياما فأشار إليهم أن اجلسوا فلما انصرف قال إنما جعل الإمام ليؤتم به فإذا ركع فاركعوا وإذا رفع فارفعوا وإذا صلى جالسا فصلوا جلوسا
Bukhari narrated it in the chapter on adhan, in the section "The Imam is Appointed Only to Be Followed," hadith 688, from the hadith of Malik, through him. It is also found in Muwatta (Yahya): 1/135. Muslim also narrated it, hadith 412, from the hadith of Hisham bin Urwa, through him.