Abu Huraira reported Allah's Messenger (ﷺ) as saying: The rider should first greet the pedestrian, and the pedestrian the one who is seated and a small group should greet a larger group (with as-Salam-u-'Alaikum)
Book 39 · Hadith 1
صحيح مسلم
Abu Huraira reported Allah's Messenger (ﷺ) as saying: The rider should first greet the pedestrian, and the pedestrian the one who is seated and a small group should greet a larger group (with as-Salam-u-'Alaikum)