Full Sharh — Riyad as-Salihin 179
وعن أبي أمامة صُدي بن عجلان الباهلي رضي الله عنه قال: قال رسول الله صلى الله عليه وسلم: “إن أولى الناس بالله من بدأهم بالسلام" ((رواه أبو داود بإسناد جيد)). ورواه الترمذي عن أبي أمامة رضي الله عنه: قيل: يا رسول الله، الرجلان يلتقيان، أيهما يبدأ بالسلام؟ قال: "أولاهما بالله تعالى" قال الترمذي : حديث حسن.
English Translation
Abu Umamah Sudaiy bin `Ajlan Al-Bahili (May Allah be pleased with him) reported:: The Messenger of Allah (ﷺ) said, "The person nearest to Allah is one who is the first to offer greeting." . The narration in At-Tirmidhi is: The Messenger of Allah (ﷺ) was asked: "O Messenger of Allah! When two persons meet, who should greet the other first?'' The Messenger of Allah (ﷺ) said, "The person nearest to Allah (i.e., one who is more obedient and therefore closer to Allah will say: As-Salam first)."
Source
Riyad as-Salihin(رياض الصالحين)
The Book of Greetings
Hadith Number
179