With regard to praying behind one whose sin is obvious, the scholars differed concerning this issue, and there are two opinions.
The first view is that it is not correct to pray behind a faasiq (rebellious sinner).
This is the view of Ahmad and Maalik.
The second opinion, that prayer behind a faasiq is valid, even if his sin is obvious, is the correct view and it is the view favoured by Shaykh Muhammad ibn ‘Uthaymeen (may Allaah have mercy on him).
For more info and the evidences of each view click here