He shunned his wife for five consecutive months
Question

What is the ruling if a man shuns his wife for five consecutive months?
Praise be to Allah.Firstly:
It is not permissible for a man to shun his wife for this length of time, unless she is defiantly disobedient, meaning that she disobeys him and does not fulfil his rights. In that case, it is permissible to shun her until she repents, because Allah, may He be exalted, says (interpretation of the meaning):
{As for those women on whose part you fear defiant disobedience, [first] admonish them, [next] refuse to share their beds, [and last] hit them [lightly]. Then if they obey you, take no further action against them. Verily, Allah is Most High, Great} [an-Nisa’ 4:34].
But if these methods do not succeed in dealing with the defiant disobedience on the part of the wife, then the man should choose an arbitrator from his family and she should choose an arbitrator from her family, who can then examine the problem and decide on a solution, as Allah, may He be exalted, says (interpretation of the meaning):
{If you fear a breach between them, appoint an arbitrator from his family and another from hers; if they both want to put things right, Allah will bring about reconciliation between them. Verily, Allah is All-Knowing, All-Aware} [an-Nisa’ 4:35].
But if there is no defiant disobedience, it is not permissible to shun the wife in this way for two reasons:
1.. The husband is obliged to keep his wife chaste, so he must have intercourse with her according to what she needs and according to what he is able to do.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) was asked about a man who is able to keep away from his wife for a month or two months without having intercourse with her; is he sinning or not? Should the husband be asked to have intercourse with her?
He replied: The man must have intercourse with his wife on a reasonable basis, and this is one of the most important rights that she has over him. It is more important than feeding her. With regard to what is obligatory in terms of intercourse, it was said that it is obligatory once every four months, or that it should be according to what she needs and according to what he is able to do, just as he should feed her according to what she needs and according to what he is able to do. The latter is the more sound of the two scholarly views."(Majmu‘ al-Fatawa  32/271).
2.. If he refuses to have intercourse with his wife – when there is no issue of defiant disobedience – for four months, he comes under the ruling on one who has vowed not to have intercourse with his wife. Therefore he should be ordered to have intercourse with her or to divorce her, and if he refuses to divorce her, the judge should issue a divorce.
The scholars of the Permanent Committee said: Regarding someone who shuns his wife for more than three months, if that is because of her defiant disobedience – meaning that she disobeys her husband with regard to the marital duties that are obligatory for her, and she persists in that after he admonishes her and reminds her to fear Allah, may He be exalted, and he reminds her of the duties that she must fulfil towards her husband – then he may shun her for as long as he wishes, so as to discipline her until she willingly fulfils her duties towards her husband. The Prophet (blessings and peace of Allah be upon him) shunned his wives and did not visit any of them for a month. As for not speaking to her, it is not permissible for a man to ignore his wife for more than three days, because of the hadith that was narrated soundly from the Prophet (blessings and peace of Allah be upon him) by Anas ibn Malik (may Allah be pleased with him), according to which he said: “It is not permissible for a Muslim to shun his brother for more than three days.” Narrated by Imam al-Bukhari and Muslim in their Sahihs, and by Ahmad in his Musnad.
With regard to a husband forsaking his wife in bed for more than four months in order to cause harm to her, when there is no shortcoming on her part in fulfilling her husband’s rights, in this case he is like one who has vowed to keep away from his wife, even if he did not actually swear an oath to that effect. So the deadline of the vow to keep away from his wife (ila’) is to be set for him, then if four months passes without him going back to his wife and having intercourse with her in the vagina, when he is able to have intercourse, and she was not menstruating or bleeding following childbirth, then he is to be ordered to divorce her. If he refuses to go back to his wife and he refuses to divorce her, the judge should issue a divorce, or annul her marriage to him, if the wife requests that.
And Allah is the source of strength. May Allah send blessings and peace upon our Prophet Muhammad and his family and companions. End quote.
Shaykh ‘Abd al-‘Aziz ibn Baz, Shaykh ‘Abd al-‘Aziz Al ash-Shakh, Shaykh Salih al-Fawzan, Shaykh Bakr Abu Zayd.
End quote from Fatawa al-Lajnah ad-Da’imah (20/261-262).
Secondly:
If the husband was travelling, and his wife did not agree to him being away for more than six months, then she should refer the matter to the judge so that he can correspond with the husband and tell him that he must return. Then if he does not return, the judge may issue a verdict as he sees fit, either divorce or annulment of the marriage.
It is the same whether the husband’s travel and absence was for a valid reason, such as his need for money and there being no work available for him in his country, or there was no valid reason. But the difference between having a valid reason and not is that if the husband had a valid reason, he does not have to return and he is not sinning if he does not return.
But if he has no valid reason, then he must return, and he is sinning if he does not return.
In either case, the woman has the right to ask for a divorce, so as to ward off the harm that she is suffering. We have discussed this previously in the answer to question no. 102311 .
And Allah knows best.