The European Council for Fatwa and Research issued the following Fatwa: “The principle in this matter is that if one’s prayer is acceptable to himself, then it remains acceptable even if it was led by another. In regards with selecting an imam
for prayer, we must try to follow the statement of Prophet Muhammad (peace and blessings be upon him) “The imam is the best at reading the Qur’an. If people are equals in that regard, then the imam is the best knowledgeable in the Sunnah. If they are equals, then the imam is to be the first to have migrated in the way of Allah. If they are equals, then the imam is to be the oldest in age. A man must not become imam over another in the latter’s home or territory, and must not reside on his premises but with his permission.” (Reported by Muslim, Abu Dawud, at-Tirmidhi, an-Nasa’i and Ibn Majah)
The fact that the imam may commit some breaches in Shari`ah does not deem his prayers unacceptable, especially that the scholars agreed that one’s prayer is acceptable behind a good or a bad imam as long as they are Muslims. It also remains that most of what some people see as
wrong-doings are merely matters of difference in views and opinions, rather than being undeniable breaches of Islam. For example, praying behind a man who wears a garment which falls below his ankles, or one who shaves his beard — all these are matters which people differ over and follow different fatwas. These acts do not make the person in question liable to be criticized, but rather advised and reminded. Indeed, one may discover that this person has knowledge in this particular matter which you do not. Therefore, if we state that criticizing the person in question is wrong, then surely praying behind him is acceptable.”