Start with one thing at a time.
Firstly be kind to yourself and your pregnancy.
Secondly what his wife does/doesn't do is not your priority right now.
Re: residency he can go to court but the question is will he? Many men in such a situation "bluff" to get their own way.
So call it. Apply to the CSA for maintenance. He will probably ask for a DNA test.
Only communicate with him via email and make sure you keep copies of everything.
If he does go to court you will need this. It will work in your favour if his emails demonstrate he is not concerned about his future child but is manipulating you.
In return make sure all your communication with him is calm and child focused. Do not communicate with him in anger/distress.
A court will not give him residency of a newborn (especially one that is breastfed) to a father without a very, very compelling reason (basically that you are unable to care for the baby and keep them safe).
Suggest going to mediation to him (the courts like parents who've tried to avoid court). If he agrees that's good if he doesn't then it's still good for you he refused.
Focus all your communication with him about your child's best interests. That is what a court wants to see. Not about your relationship or what a prick he is.
Tell him you are going to apply to the CSA and would like to use mediation to discuss contact arrangements and how to move forward in a way that supports a positive co-parenting arrangement for your child.
Don't let him bully you. Take the wind from his sails.
He most likely doesn't want residency - he just wants to use the threat to stop you claiming maintenance.
Stay calm - you can get through this.