Who says salām first
An order of precedence, and it runs the way you might not expect.
يُسَلِّمُ الرَّاكِبُ عَلَى الْمَاشِي وَإِذَا سَلَّمَ مِنَ الْقَوْمِ وَاحِدٌ أَجْزَأَ عَنْهُمْ
The one riding greets the one walking, and the one walking greets the one sitting. If one of a group gives the greeting, it suffices for them all.
The person in the higher position greets first. The greeting travels downward, not up.
The full narration
Yahya related to me from Malik from Zayd ibn Aslam that the Messenger of Allah, may Allah bless him and grant him peace, said, "The one riding greets the one walking, and when one of a group of people gives a greeting, it is enough for all of them
Source
Muwaṭṭa' Mālik · 1756
Ṣaḥīḥ
- Salim al-Hilali: Sahih Lighairihi