The Prophet ﷺ said, "When you see a funeral procession, you should stand up, and whoever accompanies it should not sit till the coffin is put down." (Using translation from Bukhārī 1310)
"إِذَا رأيتُمَ الجنازةَ فقُومُوا فمَنْ تَبَعَها فلا يَقْعُدْ حتى تُوَضعَ".