Here's the thing:
If the parents were married, they automatically have joint custody.
To remove custodial rights and responsibilities from one or other parent requires that they it be established that they are not a fit and proper person, it is a high bar, rightly so and generally means there is significant evidence (medical/ gardai / social services) to support the claim.
The primary concern is the care and welfare of the children of the marriage, so yes of course you need to have a home if you are to provide the primary care.
If you are saying that the mother wished to remove custodial rights from the father and have sole custody awarded to herself, then
a. she needed to establish that the father was not a fit and proper person (see earlier note) and
b. confirm she should provide a home for them
If the children were at risk in being with the father, they would be immediately removed (with all the usually caveats in regards to our overstretched social services).
I suspect, based on your posts, that mother moved out of family home, wished to have children live with her and was (rightly) advised that if the children were to be removed from their home and their father's care, she needed to be able to show that she had an adequate home for them. That's perfectly reasonable. The care and welfare of the children is of primary concern, which is as it should be.
If the applicant was successful in gaining sole custody and the father's rights were removed, then sadly, there was likely to be significant trauma experienced in their marriage - see earlier note (which is why I say there was more here than you or I could know).
Even if she couldn't do that at the time (provide a home) and the children remained under their father's care, she still would not have lost her custodial rights and responsibilities, unless it was established that she was not a fit and proper person (see earlier note).
Again: a parent's custodial rights and responsibilities are not removed solely because they left the family home, it would be unjust and unreasonable to do so, and bad and all as our judicial and family law system is, it's not that bad.
All other things being equal in separation / divorce cases the usual order is that parents have joint custody and one parent is the primary carer.
So to bring it back to the OP - if they feel they cannot continue as they are and that it would be 'torture' do so do; then they can move out, they will not lose custodial rights.