Hafetz Haim Halachot
Halacha 71 / 215

Hilchos Lashon Hara chapter 4, section 3

The rule of judging favorably has several details.

If the person is average – usually careful about sin but sometimes slipping – and one can explain that they did the sin without meaning to, or that they thought it was only an extra strictness, then even if they were seen breaking this prohibition several times, it is forbidden to tell about it. It is also forbidden to hate them, and according to some poskim (halachic authorities) it is a mitzvah to judge them favorably.