Sunnah.com reference : Book 2, Hadith 318English translation : Book 2, Hadith 408Arabic reference : Book 2, Hadith 413
Narrated Ibn Mas'ud (RA):
Allah's Messenger (ﷺ) said: "The one who knows [by recitation and memorization] the Book of Allah most should be the Imam of the people. If they are equal in the recitation, then the one who knows the Sunnah most and if they are equal in the Sunnah then the earliest of them to emigrate (to al-Madinah) and if they are equal in the emigration then the oldest among them in Islam. In another narration it has "agewise". And no man should lead another in prayer in his domain or sit in his place of honor without his permission."

[Reported by Muslim].
وَعَنْ أَبِي مَسْعُودٍ ‏- رضى الله عنه ‏- قَالَ: قَالَ رَسُولُ اَللَّهِ ‏- صلى الله عليه وسلم ‏-{ يَؤُمُّ اَلْقَوْمَ أَقْرَؤُهُمْ لِكِتَابِ اَللَّهِ, فَإِنْ كَانُوا فِي اَلْقِرَاءَةِ سَوَاءً فَأَعْلَمُهُمْ بِالسُّنَّةِ, فَإِنْ كَانُوا فِي اَلسُّنَّةِ سَوَاءً فَأَقْدَمُهُمْ هِجْرَةً, فَإِنْ كَانُوا فِي اَلْهِجْرَةِ سَوَاءً فَأَقْدَمُهُمْ سِلْمًا ‏-وَفِي رِوَايَةٍ: سِنًّا‏- وَلَا يَؤُمَّنَّ اَلرَّجُلُ اَلرَّجُلَ فِي سُلْطَانِهِ, وَلَا يَقْعُدْ فِي بَيْتِهِ عَلَى تَكْرِمَتِهِ إِلَّا بِإِذْنِهِ".‏ }  رَوَاهُ مُسْلِم ٌ  1‏ .‏‏1 ‏- صحيح.‏ رواه مسلم (673)‏.‏ و "سلما": أي: إسلاما.‏ و "تكرمته": الفراش ونحوه مما يبسط لصاحب المنزل ويخص به.‏