Here's the thing about a custody dispute.
Who prepares your son's meals, and supervises him while he eats them? Who plans his meals and goes to the shop to purchase the food for them? Who baths him? Who does bedtime? Who brings him to nursery, and picks him up? Who liaises with the nursery if there is a problem? Who pottytrained him? Who sits up with him in the night? Who buys his clothes? Who chooses his outfits and dresses him? Who knows his show size? Who does homework with him? Who brings him to extracurricular activities? Who takes time off work to stay home with him when he is sick? Who leaves work early for doctor appointments and check ups? Who has turned down promotions in order to avoid unexpected overtime and be at home at the same time every day?
Doing the above does not make you a better parent or a more loving one but it does make you the primary caregiver. In a custody dispute the court will try to preserve the status quo that existed when you were a couple. In most families, one parent makes career sacrifices and sacrifices earning potential to be the primary caregiver. The other parent might do half the above at the weekend and some of it during the week - bath and bedtime, for instance - but in MOST families, the bulk of weekday parenting - say 80% - is done by one parent. And court decisions reflect that, in that weekends are often split between parents with the non-resident parent getting one weekday also.
So the question is, how much of the above are you doing? Have you made the sacrifices at work? Are you taking the time off? Are you doing the grunt work of meal planning and clothes buying and shoe-size-remembering? Not just now and then but always?
If so, you have a good case to be the custodial parent and you should invest in a good solicitor to make that happen. Likewise if you and your ex-wife are one of the honestly pretty rare couples who have genuinely split the caregiving duties and sacrifices above 50-50 since day one, you will again have every chance of getting split-week 50-50 custody. Then you just need to decide if that is best for your son (most adults don't enjoy living in two places, but it can suit some people and some children very well).
Alternatively if you are very honest with yourself and find that maybe you haven't been doing 50% of the bumwiping and nursery organising, and that you don't want to make the work and salary sacrifices that being the main caregiver of a toddler demands, in all honesty it is possible to be a great, loving, fun, and influential father seeing your child one or two weekdays, every second weekend, and half of all holidays. To be honest, when they are at school and you are working full time, that is half of both of your free time together. Millions of families make it work.
And however great a dad you are now, you will be a million times better out of this poisonous relationship. It is awful for your little guy to be witnessing.