Salam
According to hadith, Prophet Muhammad (s.a.w.) was asked who should begin the greeting and he said, "The one who is riding should greet the one who is walking and the one who is walking should greet the one who is sitting and the smaller group should greet the larger group" (Ṣaḥīḥ al-Bukhārī, 6234; Muslim, 2160).