Question: A Muslim may be compelled to lie to his parents, or to his wife, or to his companions, or… so what is the ruling regarding the one who lies in embarrassment or necessity?
The answer: Lying, in general, is ugly in reason and in law, and much has come regarding that from the Book and the Sunnah, and likewise from Ali (Peace be Upon Him), and from other Imams and scholars. There is no disagreement among the scholars of the community regarding its ugliness. However, lying is divided into:
1. Lying about Allah, the Exalted, or about His Messenger (May Allah bless him and his family and grant them peace); and doing that deliberately is disbelief: "And who is more unjust than one who invents a lie about Allah?" [As-Saff:7]
2. Lying that contains harm to a Muslim; this type of lying is blatant disobedience, due to His, the Exalted, saying: "And those who harm believing men and believing women without what they have earned have borne a slander and a clear sin." [Al-Ahzab:58]. The divisions of this type are many, among them: false testimony, slandering chaste women, injuring a believer with what is not in him, and so on.
3. Lying in which there is nothing of what preceded: it is not lying about Allah, the Exalted, nor about His Messenger (May Allah bless him and his family and grant them peace), nor about the Imams, and there is no harm in it to a Muslim—neither to honor nor to wealth nor to anything else—and necessity does not call to it.
4. Lying by which the legally responsible person repels from himself or his wealth, or repels from a Muslim or from a Muslim’s wealth.
The first two types are forbidden decisively. The doer of the first is an unbeliever, and the doer of the second is an openly sinful offender.
The third type is forbidden, but one does not judge its doer as an openly sinful offender.
The fourth type is forbidden, but it is permitted as a concession to the extent by which the legally responsible person repels from himself, or his wealth, or his brother, or his brother’s wealth, and the like.
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.3