Hiding a criminal from the court, or helping him to flee or hide
Allah the Almighty says:
«وَتَعَاوَنُوا عَلَى الْبِرِّ وَالتَّقْوَىٰ وَلَا تَعَاوَنُوا عَلَى الْإِثْمِ وَالْعُدْوَانِ»
“And cooperate with one another in righteousness and piety, and do not cooperate with one another in sin and transgression.”
Therefore, it is not permissible for anyone to help a sinner or an oppressor in his sin or in his oppression and transgression, whoever he may be. It is not permissible to help this oppressor, tyrant and criminal to flee or to hide him, unless there is some benefit in it. For example, if nothing of the sort had previously come from this criminal, or if he appears to be a good man, then in such a case we can say here that concealing his fault is recommended. This is when we are certain that he will become good, or it is our strongest presumption that he will set out on the straight path and repent. But as for one who is known for corruption and spoiling, and no good can be expected of him, it is not permissible to conceal his fault, and this does not conflict with the saying of the Prophet ﷺ that whoever conceals the fault of a Muslim, Allah the Almighty will conceal his fault in this world and the Hereafter.
What is meant by this is the one in whose concealment there is some benefit. But as for one whose concealment makes him bold in evil and makes him more rebellious in tyranny, it is not permissible to conceal his fault in such a case.