Hadith 857
Abu Hurairah (May Allah be pleased with him) reported:
عن أبي هريرة رضي الله عنه أن رسول الله صلى الله عليه وسلم قال: "يسلم الراكب على الماشي، والماشي على القاعد، والقليل على الكثير” ((متفق عليه)) وفي رواية للبخاري: "والصغير على الكبير"
The Messenger of Allah (ﷺ) said, 'A rider should greet a pedestrian; a pedestrian should greet one who is sitting; and a small group should greet a large group (of people).'' [Al-Bukhari and Muslim]. The narration in Al-Bukhari adds: The Messenger of Allah (ﷺ) said, "The young should greet the elderly.''
In plain words
The one riding greets the one walking, the walker greets the one sitting, and a small group greets a larger one, with the young greeting the elder. A gentle order that trains humility in those who might think themselves above greeting first.
Reference : Riyad as-Salihin 857 In-book reference : Book 5, Hadith 14