The Messenger of Allah ﷺ said, "The one who leads the people in prayer should be the one most versed in the Book of Allah. If they are equal in recitation, then the one most knowledgeable of the Sunnah. If they are equal in knowledge of the Sunnah, then the one who emigrated earliest. If they are equal in emigration, then the eldest in age. A man is not to lead another in prayer within his domain of authority, nor sit on his place of honor in his house, except with his permission."Mahmud bin Ghaylan said that Ibn Numayr, in his version of the hadith, said, "the one most senior in age."
حدثنا هناد حدثنا أبو معاوية عن الأعمش قال و حدثنا محمود بن غيلان حدثنا أبو معاوية وعبد الله بن نمير عن الأعمش عن إسمعيل بن رجاء الزبيدي عن أوس بن ضمعج قال سمعت
قال رسول الله ﷺ يؤم القوم أقرؤهم لكتاب الله فإن كانوا في القراءة سواء فأعلمهم بالسنة فإن كانوا في السنة سواء فأقدمهم هجرة فإن كانوا في الهجرة سواء فأكبرهم سنا ولا يؤم الرجل في سلطانه ولا يجلس على تكرمته في بيته إلا بإذنه قال محمود بن غيلان قال ابن نمير في حديثه أقدمهم سنا
Muslim also narrated it in the Book of Mosques, chapter "Who has more right to lead the prayer," Hadith 673, from the narration of Abu Muawiya Dareer with this wording.There are also narrations on this subject from Abu Saeed [Muslim, Hadith 672], Anas bin Malik [Ahmad, 3/163], Malik bin Huwayrith [Bukhari, Hadith 628, and Muslim, Hadith 674], and Amr bin Salama [Bukhari, Hadith 4302].