Baby father threatening to take kids

I’m pregnant with our second child, we live in a state that I have no friends or family in but he does and I’m a stay at home mom.

We were engaged and planning to move to a state closer to my family and friends so both sides could be in our kids lives, I bought a condo and put our house up for sale (it’s in my name.) and he’s changed his mind saying he doesn’t want to move away anymore, dumped me and moved in with his parents. He admitted to talking to other girls online to make himself feel better after our breakup and now he’s threatening to make it to where I can’t move away or to take my babies even though I’ve already bought the condo in a different state!

I’m heartbroken and stressed, I have no one here he was the only person I had and now he’s gone. Please help someone I’m so lost! I’ve talked to a lawyer and she said that I have custody but that if he takes me to court he could keep me here but as of right now I can leave when I want legally with my baby, I’m supposed to move in two weeks.