Thank you for contacting About Islam with your question.
Shaykh Faraz Rabbani from SeekersHub addresses this question in the video below:
Are you’re allowed to read the prayer behind an open sinner?
The prophet (SAWS) said [quoting hadith in Arabic] pray behind every virtuous person and every openly corrupt person.
And that meaning, if you go to the masjid, and there’s someone you know that this guy’s way out there: you pray behind him.
Now, when you have a choice: it’s common sense. There’s two local masjids. One there’s someone righteous: one is led by someone who is openly sinful. You choose virtue. You choose righteousness.
But sometimes when you don’t have a choice, or you’re at work and an uncle leads prayer, but you know him to be, you know, abusive or whatever: you still pray in congregation. You still pray in congregation.
And we do not create fitna [strife]. We do not create fitna. Contrary to what some people may appear to believe, fitna is a biddah [innovation] and it had nothing to do with the Sunnah, right?
So, we avoid that, right? And where possible, we appoint someone more suitable and we take the means, but in a good way, in a good way.
I hope this helps answer your question. You can also check out more from SeekersHub at the link here.
Walaikum Asalam. Please keep in touch.
Please continue feeding your curiosity, and find more info in the following links: