All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
We have already issued Fataawa 82989, 82654 and 83718 clarifying the ruling of praying behind an innovator, a person who commits Shirk (association with Allaah) or a person who blindly imitates others. We have also issued Fatwa 84271 clarifying that if the prayer of a person is valid for himself so it is also valid for others who pray behind him; so please refer to all these Fataawa.
Finally, the following matters should be mentioned:
1- In principle, a Muslim is free from Shirk and innovations, so it is not permissible to suspect a Muslim whether he is an Imaam or else without evidence. Thus, if one is unaware of the condition of the Imaam, then in principle he is innocent unless there is evidence which proves otherwise.
2- It is very serious to declare a specific person to be a non-Muslim without making sure that the conditions of declaring a person as a non-Muslim or dissolute are confirmed on him and that there are no other impediments [which prevent from declaring him as such]. A Muslim may commit an act of Shirk but is not ruled to be a non-Muslim because of the existence of impediments which prevent from declaring him as such, like if him misinterpreting something and the like. For more benefit in this regard, please refer to Fatwa 91567.
Therefore, one should be very careful about this and a Muslim should not suspect his other Muslim brothers.
Allaah Knows best.