the one most proficient in recitation, then the one most knowledgeable of the sunnah, then the one who emigrated earliest, then the one who embraced Islam earliest, then the eldest.
As for God-fearingness, it is a quality that must undoubtedly be taken into consideration in the case of all of these; no weight is given to nobility of lineage.
Then the one selected by lot. And the resident of the house, …
His statement, “Then the one selected by lot,” means that if two men are equal in all these ranks, then in such a case we use a drawing of lots; whoever is selected by lot has the greater right. Thus, if a group gathers intending to pray, and one of them says, “I will lead,” while the second says, “I will lead,” and we find that they are equal in all the relevant qualities, then we draw lots between them, unless one of them relinquishes his claim. Whoever is selected by lot is the imam.
There is no fixed form for drawing lots; rather, it is according to whatever the people agree upon. For example, we may write “imam” on one slip and leave the other blank, mix them together, give them to someone, and say, “Give each of these two men a slip.” If the slip bearing “imam” falls into the hand of one of them, he is the imam. Or it may be done in some similar manner. However they draw lots, it is permissible.
If someone were to ask, “What is the evidence for using the drawing of lots in acts of worship?” We say: The Prophet, peace and blessings be upon him, said, “If the people knew the reward of the call to prayer and the first row, and could find no way to attain them except by drawing lots, they would draw lots.” (1) This is a clear text establishing that drawing lots applies to the call to prayer and the first row when people contend over them.