وَأَوْلَى النَّاسِ بِالْإِمَامَةِ أَعْلَمُهُمْ بِالسُّنَّةِ، فَإِنْ تَسَاوَوْا فَأَقْرَؤُهُمْ، فَإِنْ تَسَاوَوْا فَأَوْرَعُهُمْ، فَإِنْ تَسَاوَوْا فَأَسَنُّهُمْ.
Meaning: The person most entitled to lead is the one most knowledgeable of the Sunnah. If equal, the better Quran reciter; if equal, the more scrupulously pious; if equal, the older.
The four steps are knowledge of Sunnah, Quranic recitation, piety, and age.