وَشُرُوطُ صِحَّةِ الْإِمَامَةِ لِلرِّجَالِ الْأَصِحَّاءِ سِتَّةُ أَشْيَاءَ: الْإِسْلَامُ، وَالْبُلُوغُ، وَالْعَقْلُ، وَالذُّكُورِيَّةُ، وَالْقِرَاءَةُ، وَالسَّلَامَةُ مِنَ الْأَعْذَارِ
The six are:
1. Islam.
2. Puberty.
3. Sanity.
4. Male sex for leading men.
5. Ability to perform the minimum valid Quranic recitation.
6. Freedom from a disqualifying chronic excuse or missing prayer-condition relative to the followers — examples in the commentary include continuous nosebleed, certain severe speech impediments, lack of Taharah, or uncovered Awrah.
These are validity conditions for the stated leadership situation, not a ranking of personal worth.