Hadith 5198
Abu Hurairah reported the Messenger of Allah ﷺ as saying: The young should salute the old, the one who is passing by should salute the one who is sitting, and a small company should salute a large one.
Hadith 5199
Abu Hurairah reported the Messenger of Allah ﷺ as saying: one who is riding should salute one who is walking. He then mentioned the rest of the tradition.