[Machine] The Messenger of Allah ﷺ prayed in his house while sitting, and a group of people prayed behind him while standing. He gestured to them to sit, and when he finished, he said, "The Imam has been appointed to be followed. When he bows, you should all bow, and when he raises his head, you should all raise yours, and when he prays while sitting, you should all pray sitting." Al-Shafi'i added in his narration while he was doubtful, "and when he prays while sitting."
صَلَّى رَسُولُ اللهِ ﷺ فِي بَيْتِهِ وَهُوَ جَالِسٌ فَصَلَّى وَرَاءَهُ قَوْمٌ قِيَامًا فَأَشَارَ إِلَيْهِمْ أَنِ اجْلِسُوا فَلَمَّا انْصَرَفَ قَالَ إِنَّمَا جُعِلَ الْإِمَامُ لِيُؤْتَمَّ بِهِ فَإِذَا رَكَعَ فَارْكَعُوا وَإِذَا رَفَعَ فَارْفَعُوا وَإِذَا صَلَّى جَالِسًا فَصَلُّوا جُلُوسًا زَادَ الشَّافِعِيُّ فِي رِوَايَتِهِ وَهُوَ شَاكٌّ فَصَلَّى جَالِسًا