Etiquette of offering Greetings

Imam Al-Nawawi’s Riyad-us-Saliheen
Chapter 133
Etiquette of offering Greetings

857. Abu Hurairah (May Allah be pleased with him) reported: Messenger of Allah (sallallaahu ’alayhi wa sallam) 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: Messenger of Allah (sallallaahu ’alayhi wa sallam) said, “The young should greet the elderly.”

858. Abu Umamah Sudaiy bin `Ajlan Al-Bahili (May Allah be pleased with him) reported: The Messenger of Allah (sallallaahu ’alayhi wa sallam) said, “The person nearest to Allah is one who is the first to offer greeting.”
[Abu Dawud].

The narration in At-Tirmidhi is: The Messenger of Allah (sallallaahu ’alayhi wa sallam) was asked: “O Messenger of Allah! When two persons meet, who should greet the other first?” The Messenger of Allah (sallallaahu ’alayhi wa sallam) said, “The person nearest to Allah (i.e., one who is more obedient and therefore closer to Allah will say: As-Salam first.”