The Messenger of Allah ﷺ said, "The one who leads a people in prayer should be the most knowledgeable among them in the Book of Allah. If they are equal in their recitation, then the one most learned in the Sunnah. If they are equal in the Sunnah, then the one who emigrated earliest. If they are equal in emigration, then the one who embraced Islam first. A man should not lead another in prayer within his domain of authority, nor sit in his house upon his place of honor without his permission."In another narration, instead of "embraced Islam first," it says "the eldest in age."
قال رسول الله ﷺ: يوم القوم أقرؤهم لكتاب الله، فإن كانوا في القراءة سواء فأعلمهم بالسنة، فإن كانوا في السنة سواء فأقدمهم هجرة، فإن كانوا في الهجرة سواء فأقدمهم سلما، ولا يؤمن الرجل الرجل في سلطانه، ولا يقعد في بيته على تكرمته إلا بإذنه. وفي رواية: مكان سلما سنا.
Muslim narrated it in the Book of Mosques (673) via Abu Khalid Ahmar, from Amash, from Ismail bin Raja, from Aws bin Damaj, from Abu Masud Ansari, who related it. His saying "salman" means "safely" [i.e., in submission].