The Messenger of Allah ﷺ said, "When you see a funeral procession, stand up for it, and whoever follows it should not sit down until it is set down."
حدثنا نصر بن علي الجهضمي والحسن بن علي الخلال الحلواني قالا حدثنا وهب بن جرير حدثنا هشام الدستوائي عن يحيى بن أبي كثير عن أبي سلمة
أن رسول الله ﷺ قال إذا رأيتم الجنازة فقوموا لها فمن تبعها فلا يقعدن حتى توضع
Reported by Bukhari and Muslim.Bukhari narrated it in the Book of Funerals, Chapter: Whoever follows a funeral procession should not sit until it is placed down, etc., hadith no. 1310, and Muslim, hadith no. 959, both from the hadith of Hisham Dastawai, with the same chain.