1. It is an adab (Islamic etiquette) that the one who is walking should greet the one who is sitting first. The one who is riding a conveyance should greet the one who is walking first. Similarly, the young should greet the elders first, and a small jamaat (those that are fewer in number) should greet the bigger jamaat (those who are many) first.
عن أبي هريرة رضي الله عنه عن النبي صلى الله عليه و سلم قال يسلم الراكب على الماشي والماشي على القاعد والقليل على الكثير وزاد ابن المثنى في حديثه ويسلم الصغير على الكبير (مسلم رقم 2703)
Hazrat Abu Hurayrah (Radhiyallahu Anhu) reports that Rasulullah (Sallallahu Alaihi Wasallam) said: “The one who is riding a conveyance should greet the one who is walking first. The one who is walking should greet the one who is sitting first. Those that are few in number (a small group) should greet those that are many (a big group) first. The young should greet the elders first.”
Note: Though the Islamic etiquette is that these groups mentioned in the Hadith should greet first, however each one should endeavour to make salaam first, as it was the sunnah of Rasulullah (Sallallahu Alaihi Wasallam) to greet first upon meeting.