Question:
The Imams of this masjid usually shave their beards. Is it better to perform salah in congregation behind them or alone at home?
Answer: حامدا ومصليا ومسلما
The one who cuts or shaves his beard is a fasiq (open sinner). The Imamat of a fasiq is makrooh tahreemi (highly reprehensible). To appoint such a person as an Imam is not permissible. You should look for a righteous imam in another masjid. However, if you do not find one, then perform salah behind the fasiq, but do not abandon the congregational prayer.
( مأخوذ از مسائل امامت ص 59)
And Allah Ta’aalaa knows best.
Hazrat Mufti Ahmad Khanpuri Saheb (May Allah preserve him)
Mahmoodul Fataawaa