Praise be to Allah.
The one who is most entitled to lead the prayers is the one who has most knowledge of the Book of Allaah and who has most knowledge of the fiqh of prayer and is most keen to ensure that his prayer is correct. That includes doing the essential parts and obligations of the prayer in the required manner. But if he does not do the prayer or one of its essential parts, such as rukoo’, properly, then the matter is subject to further discussion:
-If he is unable to stand or bow or prostrate for a valid reason such as sickness etc., then there is a difference of opinion among the scholars. The most correct view is that his leading the prayers is valid because of the general meaning of the hadeeth of the Prophet (peace and blessings of Allaah be upon him): “The people should be led in prayer by the one who has most knowledge of the Book of Allaah.” This is the madhhab of al-Shaafa’i (may Allaah have mercy on him), as it says in al-Majmoo’, 4/264, and this was the view favoured by Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him) as was narrated from him in al-Insaaf, 4/374.
If the reason is ignorance or stubbornness, then his mistake should be pointed out to him. If he responds, all well and good, otherwise it is not permissible for him to lead the people in prayer, even if he is hafiz, because his prayer is invalid due to his failing to do one of the essential parts of prayer. See Question no. 1875.