He stood up after the first two units of prayer, and the people said "Subhan Allah" to alert him, but he did not sit down. When he finished his prayer, he performed two prostrations after the closing salutation, then said, "This is how the Messenger of Allah ﷺ did it."
حدثنا عبد الرزاق أخبرنا سفيان عن ابن أبي ليلى عن الشعبي
أنه قام في الركعتين الأوليين فسبحوا به فلم يجلس فلما قضى صلاته سجد سجدتين بعد التسليم ثم قال هكذا فعل رسول الله ﷺ
Its isnad is sahih, mentioned previously at 18081.18091m - Hashim bin Qasim narrated to us, Mubarak narrated to us, saying, Ziyad bin Jubayr informed me, my father informed me, from Mughira bin Shuba, from the Prophet ﷺ, who said, "The rider goes behind the funeral procession, and the one on foot walks in front of it, near its right side or its left side. The stillborn child is prayed over, and forgiveness and mercy are asked for its parents."Sahih (18091m). Its isnad is sahih, mentioned previously at 18080.