You need the help of a solicitor or at very least Citizens Advice.
Having been through a divorce, I’ll tell you how I remember it!
There is no such thing as custody today, they replaced it with Parental Responsibility, with the possibility of a residency order (if needed).
Parental Responsibility (IMHO) was put in place as the courts were fed up with dealing with custody battles, and want the parents to sort things out amicably.
If you can’t, a pair of solicitors, or God forbid a court, (from both your input and compromise) will decide whom the children should reside with (it may be 50/50). Of course, again imho they usually choose the Mother has more residency time, unless it’s obvious you have been the main carer.
I’m not a solicitor and suggest you seek one asap.