Can You Swear  by the Quran?
Question

I swore an oath that my brother should not sleep in the house, and I said “By the life of the Quran, you shall never sleep in the house.” Then he slept in the house. What do I have to do?
Praise be to Allah.Can you swear by the Quran?
In the answer to question no. 122729  we stated that it is permissible to swear by the names and attributes of Allah. 
The Quran is the Word of Allah , and His Word is one of His attributes, so it is permissible to swear by the Quran. 
The scholars of the Standing Committee said: 
“It is permissible to swear by Allah and His Attributes. The Quran is the Word of Allah, which is one of His attributes, so it is permissible to swear by it .” (Fatawa al-Lajnah ad-Daimah, 1/354) 
Swearing by the life of the Quran 
Swearing by the life of the Quran is not mentioned, as far as we know, in Islam, either in the Book of Allah or the Sunnah of His Messenger (blessings and peace of Allah be upon him) or the words of any of his Companions (may Allah be pleased with them). 
It seems that the one who swore by this oath intended to swear by the Quran and spoke in the manner of the common folk when they swear by the life of that by which they are swearing. What appears to be the case is that it comes under the same rulings as the ruling on one who swears by the Quran. 
Shaykh Ibn Baz (may Allah have mercy on him) was asked: 
We have many people who swear by things other than Allah. For example they say, “By the life of the Prophet Muhammad (blessings and peace of Allah be upon him)” or “By the life of ‘Isa” or “By the life of Musa (peace be upon him)” or “By the life of the Quran” or “By the life of my father’s grave” or “I swear by my honour”. Please advise me about that; may Allah reward you with the best of rewards. 
He replied: 
“Swearing by anything other than Allah is not permissible. Rather the oath should be by Allah Alone, may He be glorified and exalted, because it is proven that the Messenger of Allah (blessings and peace of Allah be upon him) said: “Whoever swears an oath, let him not swear by anything except by Allah, or else let him remain silent.” 
And he said: “Whoever swears by anything other than Allah has associated something with Him (shirk).” Swearing by anything other than Allah is one of the haram actions that constitute kufr (disbelief), but it comes under the heading of minor shirk, unless he meant that this by which he swore was as great as Allah, or that it has control over the universe, or that it deserves to be called upon instead of Allah, in which case it becomes major kufr (al-kufr al-akbar) – Allah forbid. 
So if he said “By the life of So and So” or “By the life of the Messenger” or “By the life of Musa” or “By the life of ‘Isa” or “By my father’s grave”, or he swore by honesty or by the Ka`bah and so on, all of that is swearing by something other than Allah, and all of that is not permissible and is an evil action. 
What should be done is to not swear by anything except Allah, may He be glorified and exalted, or by one of His attributes, or by one of His names. The Quran is the Word of Allah, and the Quran is one of the attributes of Allah. So if a person says “By the Quran” or “By the life of the Qur’an”, there is nothing wrong with that, because the Quran is the Word of Allah, may He be glorified and exalted.” (Fatawa Nur ‘ala ad-Darb by Ibn Baz, p. 236-237) 
What is the expiation for breaking an oath? 
If a person swears that his brother or someone else should not sleep in the house, then he sleeps there, he has to offer expiation for breaking an oath . 
The scholars of the Standing Committee were asked: 
“I swore an oath to someone, saying: “By Allah, you should not slaughter the animal,” but he did not heed my words and he slaughtered it, and I ate some of it. Is there any sin on me, and is there any expiation I have to offer? If there is any expiation I must offer, please advise me about it. 
They replied: If the situation is as you describe, there is no sin on you for eating from it, but you have to offer expiation for breaking an oath , by feeding ten poor persons with the same kind of food as you eat, or clothing them, or freeing a believing slave. If none of that is possible, then you have to fast for three days.” (Fatawa al-Lajnah ad-Daimah, 23/85) 
Ibn Baz (may Allah have mercy on him) was asked: 
I have children and I often swear that they should not do such and such, but they do not respond to my words. Do I have to offer any expiation in this case? 
He replied: 
“If you swear an oath to your children or anyone else, with the aim that they should do something or should not do something, then they go against that, you have to offer expiation for breaking an oath.” (Majmu‘ Fatawa Ibn Baz, 23/119) 
Can you break an oath if you see that something else is better? 
If your oath to your brother that he should not sleep in the house was the result of an argument, then it is not Islamically appropriate. When you swore that oath, what is Islamically prescribed in your case is to break the oath and offer expiation for it, because of the report narrated by al-Bukhari (6718) and Muslim (1649) from Abu Musa al-Ash‘ari (may Allah be pleased with him), according to which the Prophet (blessings and peace of Allah be upon him) said: “By Allah, if Allah wills, I do not swear an oath then see something better than that, but I expiate my oath and do that which is better.” 
And Muslim (1650) narrated that Abu Hurayrah (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Whoever swears an oath then sees that something else is better than it, let him do that and offer expiation for his oath.” 
An-Nawawi (may Allah have mercy on him) said: 
“These hadiths indicate that if a person swears to do something or not to do something, and breaking the oath is better than adhering to it, it is mustahabb for him to break the oath and he has to offer expiation. This is something agreed upon.” 
And Allah knows best.