He swore that he would not go near his wife for two months, and if he did so, she would be divorced
Question

There was a minor issue between me and my wife, and I swore an oath by Allah to my wife that I would not go near her (have intercourse with her) for two months, and if I did that, she would be divorced. What is the ruling on that? If I go near her during the specified period, will she be divorced or do I have to offer expiation for breaking an oath (kaffarat yamin)?
Praise be to Allah.Firstly:
If a man swears that he will not have intercourse with his wife for a period of less than four months, this is ila’ (an oath of abstinence) according to the most correct scholarly opinion, and it is the view of a number of the Tabi‘in. So if he does not have intercourse with her throughout that period, he does not have to do anything, but if he does have intercourse with her during that period, he must offer expiation for breaking an oath.
Ibn Qudamah (may Allah have mercy on him) said: An-Nakha‘i, Qatadah, Hammad, Ibn Abi Layla and Ishaq said: Whoever swears an oath that he will not have intercourse with his wife for a short period of time or a long period of time, and he does not have intercourse with her for four months, then this is ila’ (an oath of abstinence), because Allah, may He be exalted, says (interpretation of the meaning):
{For those who swear not to have sexual relations with their wives is a waiting time of four months} [Al-Baqarah 2:226].
This is an oath of abstinence."(Al-Mughni  7/415).
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) said: Regarding the words ‘More than four months’, the apparent meaning of the author’s words indicates that if he swears that he will not have intercourse with her for four months only, that is not ila’ (an oath of abstinence), or if he swears that he will not have intercourse with her for three months, that is not ila’ (an oath of abstinence) either. However, the correct view is that it is ila’ (an oath of abstinence), because Allah, may He be exalted, says (interpretation of the meaning):
{For those who swear not to have sexual relations with their wives is a waiting time of four months} [Al-Baqarah 2:226].
So Allah confirms that it is ila’ (an oath of abstinence), but He stipulated that the period they must wait for is four months. So if someone says: By Allah, I will not have intercourse with my wife for three months, then this is ila’ (an oath of abstinence), because he has sworn not to have intercourse with her, but we do not say anything to him for now, because once that period (three months) has passed, his oath is no longer binding. For example, a man says to his wife: By Allah, I will not have intercourse with you for a period of three months. In this case, we say: This is ila’ (an oath of abstinence), but we do not impose on him the consequences of that oath; rather we wait until three months have passed, and once that period ends, the ruling on his oath is no longer binding."(Ash-Sharh al-Mumti‘  13/218).
Secondly:
With regard to your saying, ‘If I go near her, she will be divorced,’ this is a divorce that is dependent upon a condition being met. The majority of jurists are of the view that divorce takes place when that condition is met, so if you have intercourse with her, it counts as one divorce (talaq).
Some of the scholars are of the view that reference should be made to the husband’s intention. If he intended that divorce should take place when the condition was met, then it counts as one divorce, but if he did not intend that divorce should take place – rather he wanted to threaten her or prevent himself from doing that – then this is an oath for which he must offer expiation when it is broken. This is the more correct view, and it is the view favoured by Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) and others.
What we think is that you should keep away from your wife until the two months are over, so as to avoid divorce taking place, because the majority of scholars, including the four imams, regard divorce as taking place in a case such as this.
What is strange is that you hastened to swear this oath and issue a conditional divorce even though the problem between you and your wife was minor, as you mentioned. What the husband should do is fear Allah, may He be exalted, and adhere to the limits He has set, and not use divorce as a means to issue threats or vent his anger.
We ask Allah to rectify all our affairs.
And Allah knows best.