Your son is old enough to be told the truth, almost the unvarnished truth.
Sit him down and talk him through it ALL. Show him the finances, tell him that his dad has one version of what is happening and you have another. That there is no reason for him, DS, to have been dragged into any disagreement but, now that he has, you will treat him as an adult and tell him grown up truths!
Tell him you love him and understand that he wants a relationship with his dad. Tell him that he can have both of you, he does not have to choose ever
Tell him he can live with hsi dad if that is what he wants to do but that his room will always be waiting for him and he can visit, stay over, return whenevr he wants to.
Help him pack, remind him of the things he will miss, ask him if he wants to leave some things with you for when he sleeps over, what he thinks he will need 2 of.
Tell him you will really miss him but that you won't stop him living with his dd, or comong home to you whenever he wants to.
Basically love him to bits and be the most reasonable you can be. Make him see the stark distinction between you nad his dad, that you relly do want what is best for him.
He'll soon see through his dad and come home.
If he doesn't, well, you will have to find a way to deal with that if it happens. But I would agree, you can't lock him into your home via the courts. Yuu will only be proving his dad right!
DSis went through similar with her DS. Absentee father suddenly came over all Disney! DN saw through him in about 4 days!