Lying and backbiting are huge sins and as Muslims we must strive to be honest in our words and actions. The Prophet (salAllahu alayhi-wassalam) only permitted a Muslim to lie only in three occasions, as telling a lie in these three occasions resulted in a greater good for Muslims.
Umm Kulthum bint Uqbah (radiyAllahu anha) narrated that The Messenger of Allah (salAllahu alayhi wasallam) said: ‘The person who (lies) in order to conciliate between people is not at all a liar, as he conveys good or says (something) good.’ [Sahih alBukhari & Muslim]. The narration in Muslim added: She said, ‘I never heard him (she meant the Prophet salAllahu alayhi wasallam) giving permission of lying in anything except in three (things): war, conciliating between people and the conversation of a man with his wife and the conversation of a woman with her husband.’
The Prophet gave permission for Muslims to tell a lie, in a war to keep the enemy unaware of the true position of Muslims. Secondly in order to improve the relationship between two estranged family members, if telling a lie is likely to remove conflict and anger. Thirdly between a husband and wife, which may be in the form of giving a compliment, where the spouse may not actually believe what they are saying, such as complimenting their spouse on a meal that they have made, even if they don’t really like it. This hadith signifies the importance of maintaining good relationships with family members, to the extent that one is even permitted to say a lie in order to restore harmony in relationships and maintain a pleasant atmosphere in family life.