Al-Yameen is to swear by Allah, the Mighty and Sublime, or with any of His Names or Attributes. It is not allowed to swear by other than Allah, not the Prophet (ﷺ) nor Jibreel (عليه السلام) nor any of the creatures. This is due to the saying of the Prophet (ﷺ): “Whoever is to swear should swear by Allah or keep silent.”(1) He also said: “He who swears with other than Allah has committed Kufr or Shrik.”(2)
1 Reported by Al-Bukhaari in the Book of Oath Making and Swearing, Chapter on Do not Swear with Your Fathers; no. 6646, and Muslim in the Book of Oath Making, Chapter on Prohibition of Swearing by Other than Allah; no. 1646.
2 Reported by Aboo Daawood in the Book of Oath Making and Swearing, Chapter on Prohibition of Swearing with Forefathers; no. 3251, At-Tirmidhee in the Book
Therefore, whoever swears by other than Allah is a sinner and such swearing is ineffectual and null based on the saying of the Prophet (ﷺ) that, “Whoever does an act which is not in agreement with our affair will have it rejected.”(1)
In addition, it is not good for the individual to always swear; this is the meaning of Allah’s the saying - the Exalted – that,
“...and protect your oaths.” (Al Maaidah: 89) according to the view of some of those who gave the explanations (of the meanings) of the Qur’aan. They said, “...and protect your oaths” means, do not swear by Allah unduly; when you declare and oath you should rather delimit it with Allah’s Will. You should say, “By Allah, if Allah wills” so that you achieve two great benefits from that,
The first benefit: The matter over which you swore becomes easy for you.
The second benefit: You would not be obliged to expiate if the oath becomes broken. The one who makes an oath and says, “insha Allah (Allah willing)” would not have violated the oath even if he reverses it. However, the oath that makes atonement obligatory is that made in respect to a future issue. As for those regarding past events, there is no expiation on it. Nonetheless, if the one who swears is a liar, then he is a sinner but there is nothing on the individual if he is truthful. An example of this is if a person says, “By Allah, I did not do such-and-such.” Here, atonement is not obligatory on him whether he is truthful or lying. If truly he did not do it, then he is saved from sin; but if it is a lie such that he actually did it; then he is being sinful.
The swearing requiring atonement are those regarding future occurrences. Hence, if you swear about an upcoming matter like saying, “By Allah, I shall not do such-and-such.” In this case, we say: If you (later) do that thing, then it becomes binding on you to expiate; but not if you do not do it. Such are established oaths; expiation would be obligatory if you do but not if you do not carry them out. However, is it better to implement what I swore to abandon or not carrying it out is better?
of Oath Making and Swearing, Chapter on Whoever Swears with Other than Allah has Committed Shirk; no. 1535, Imam Ahmad in the Musnad (2/86,87) and al-Haakim in al-Mustadrak (1/18); he graded it authentic on the conditions of both of them (i.e., Al-Bukhaari and Muslim) and Ad-Dhahabee agreed with him.
In this hadeeth, the Prophet (ﷺ) explained that if you swear regarding a thing but find other than it closer to piety of Allah, then expiate for your oath and carry out the better one. For instance, a person says, "By Allah, I will not talk to so-and-so" who is a Muslim, the superior act of piety before Allah is to talk to him because boycotting a Muslim is prohibited. So, talk to him and expiate for (breaking) your oath because this is the loftier act of piety before Allah.
If you have said, "By Allah, I will not visit a relation." Here, we say visiting the relations is maintaining the ties of kinship, which is obligatory. Hence, keep your relations and atone for breaching your oath. This is because the Prophet (ﷺ) said: "...but if he finds something else better than that (which brings him closer to Allah) then he should do that which is better in piety and he should expiate for the breaking of oath."(1) Therefore, you should weigh other issues on this basis.
In summary, we say, if it relates to a past event, there is no need discussing atonement for breaking an oath because such oaths are not effectual. However, the one who makes the oath would be free from sin or actually sin if he is deceitful; but he is free from sin if he is honest.
As regards swearing concerning future events, that involves expiation. So if the person swears about a future occurrence and later acts contrary then expiation becomes obligatory upon him. However, if he combines the oath with Allah's Will, by saying (while making the oath) that, "If Allah wills", there is no expiation for him even if he breaks the oath in the end.
Allah alone grants success.