Praise be to Allah.
It is permissible to cover up for him if he is not one of those who take the matter of sin lightly and he is not known to commit a lot of sins or to commit prohibited actions. In this case, he should advise him, tell him to fear Allah and warn him against doing it again.
But if he is a person who regularly commits sin and evil deeds, then the one who finds out about it will not have discharged his duty until he refers the matter to someone who can punish him in a way that will deter him from persisting in it.
If the sin affects the rights of another person, such as if he sees him stealing from someone’s house or shop, or he sees him committing adultery with the wife of So and so, then it is not permissible for him to cover up for him, because that is a transgression against the rights of another person, it affects that person’s marriage and is a betrayal of another Muslim. Similarly, if he finds out that he killed or injured a Muslim, he should not cover up for him and cause the rights of a fellow Muslim to be neglected; rather he should testify against him to the relevant authorities, so that matter may be dealt with. And Allah knows best. End quote.
Shaykh ‘Abdullah ibn Jibreen (may Allah preserve him).