alking behind the back of others is not a sin if it is:
1. With the aim of justice,
2. With the aim of prohibition of evil,
3. With the aim of asking questions,
4. About pseudo-scientists,
5. About persistent sinners.
All the people may commit sins every once in a while, as no one is innocent. People should not embarrass each other by talking about their mistakes and vices.
For example, it is not a sin to talk behind the back of a person who refuses to say his prayers, does not realize his mistake, and even recommends others to follow his path too.
It is not also a sin if people talk about someone’s flaw with the aim of finding a solution. Like, it is ok if the students are talking about a teacher who does not teach well, if they aim to find a way to solve the problem and if they do not mean any harm or reproach.
Another instance is a person who is treating others unfairly; for example a host who does not treat his guests well. Talking about such a person and his negative attitude towards his guests is not a sin either.
One of the attributes of God is that he hides people’s flaws. People should try to be like that too and try not to disgrace others. All the people have weak points and if everyone talks about the negative aspects of others, pessimism will prevail the society and people won’t be able to work with each other. Therefore, because of both social bonds and people’s honour, one should not reveal others’ vices without having a good intention.
source : tebyan