Assalamualaikum ustaz. Who should one prioritize and is eligible to be an imam for prayer?
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions and all those who follow his footsteps until the Last Day.
Islam encourages us to always perform congregational prayer. This is the sunnah of Rasullullah PBUH and his rewards are multiplied. The Rasullullah PBUH said:
صَلاَةُ الْجَمَاعَةِ تَفْضُلُ صَلاَةَ الْفَذِّ بِسَبْعٍ وَعِشْرِينَ دَرَجَةً
“Prayer said in a congregation is twenty-seven degrees more excellent than prayer said by a single person.”
Sahih al-Bukhari (645)
According to the above question, we state:
An imam means a person who is followed by others, just like an imam during prayer, as a caliph or army commander.  the word imam itself means in front who is a person referred to and followed by his followers known as the makmum. This is based on the hadith of Prophet PBUH:
اِنَّمَا جُعِلَ الإِمَامُ لِيُؤتَمَّ بِهِ
“The imam is appointed only to be followed,” 
In answering this question, we present a hadith narrated by Abu Mas’ud, he said the Prophet PBUH told us:
يَؤُمُّ الْقَوْمَ أَقْرَؤُهُمْ لِكِتَابِ اللَّهِ وَأَقْدَمُهُمْ قِرَاءَةً فَإِنْ كَانَتْ قِرَاءَتُهُمْ سَوَاءً فَلْيَؤُمَّهُمْ أَقْدَمُهُمْ هِجْرَةً فَإِنْ كَانُوا فِي الْهِجْرَةِ سَوَاءً فَلْيَؤُمَّهُمْ أَكْبَرُهُمْ سِنًّا وَلاَ تَؤُمَّنَّ الرَّجُلَ فِي أَهْلِهِ وَلاَ فِي سُلْطَانِهِ وَلاَ تَجْلِسْ عَلَى تَكْرِمَتِهِ فِي بَيْتِهِ إِلاَّ أَنْ يَأْذَنَ لَكَ أَوْ بِإِذْنِهِ
“The one who is well-grounded in Allah’s Book and is distinguished among them in recitation should act as; Imam for the people. and if they are equally versed in reciting it, then the one who has most knowledge regarding Sunnah; if they are equal regarding the Sunnah, then the earliest one to emigrate; If they emigrated at the same time, then the oldest one in age.” 
According to this hadith, scholars of madhhab al-Syafie has written this matter in their books. The following is the order of eligibility of a person to be the imam when the specific or mosque-appointed imam is not available according to Ibn Naqib al-Masri in his book Umdah al-Salik (128):
- The most faqih (knowledgeable and understands) the rulings of Islam’s shariah, especially in matters related to the validity of prayer and others.
- Has the best Quran recitation.
- The most warak (those who avoid syubhah (doubtful matters))
- The earliest to migrate to the Islamic government of Medina and his progeny.
- The earliest to embrace Islam.
- The most honoured in terms of his lineage following the order starting from Bani Hashim, Bani Muthalib, followed by Quraisy, then the Arabs, it is prioritized that a pious and knowledgeable child from the above-stated lineage.
- The best in character and conduct.
- The cleanest body and clothing.
- The most euphonious voice.
- The best in appearance.
We once heard and watched a video where Syeikh Muhammad Khalil al-Husari, Syeikhu al-Qurra’ Egypt who is a famous muezzin praying following Syeikh al-Azhar at the time, Syeikh Abdul Halim Mahmud as his imam.
If the appointed imam in a certain mosque or surau isn’t available, then anyone with one of the criteria listed above can be chosen according to the order. We conclude that those who are faqih (knowledgeable) according to madhhab Syafie should be prioritized for they would have comprehensive knowledge about the whole prayer rather than just having a melodious voice. May all of us be guided to follow the shariah of Islam.