I am so sorry that you are going through this. Since you’ve already established that your ex is emotionally and mentally abusive, he’s obviously doing this to torment you.
If there is any way you can lead him to believe that you can reconcile (just long enough for you to get Rex and leave) maybe you can try that.
I don’t want to recommend anything illegal, but if you can get into his residence (since it was your residence too) when he’s not home, maybe you can take Rex and move away.
Possession is 90% of the law and since in most States a dog is considered “property” (we all know they are so much more than that), if you have him the Law might be on your side.
Please consult a Lawyer to see if you can get him back legally. BUT, sometimes you have to fight fire with fire.
Good luck and let us know how it goes.