I feel a lot of empathy for the OP, having been in a similar situation… twice.
After my first marriage, I was entirely, completely, totally gunshy. There were lots of issues during the marriage, and afterwards, he took our children out of state, without my permission. Because of my emotional and financial position at the time, there was damn-all I could realistically do about it: Even if I could have forced him to bring them back, or gained sole custody of them (we had previously agreed to joint custody,) I couldn’t have taken care of them at the time. I was a mess, and not making enough money to pay my bills, much less pay to feed/clothe/house/take care of two children…
Fast-forwarding a bit, I began dating someone (far too soon after the previous mess, honestly, but that’s beside the point,) we moved in together, etc. He asked me more than once to marry him, both before and after we found out we were expecting. I repeatedly said no, for a couple of reasons. First off, I was the classic “once bitten, twice shy,” and secondly, I knew that, in the unlikely event that there were ever a custody battle over our children, he would have to do a lot more work to gain standing in the courts. Frankly, I didn’t trust him as much as I should have trusted someone with whom I shared a home and family. (I even waited to move in with him until after the state’s common law marriage law was repealed.) We lived together as man and wife for seven years, I helped raise his older kids, we shared finances and a business, etc., but I never wanted to marry him. I don’t regret that time, but I also don’t regret my decision.
Second “not-husband” and I split up in 2004 - he left me for the woman he’d been dating, because she was pregnant! At that time, I swore off anything even beginning to resemble marriage. Huh-uh, not me, never, ever again! Sure, I dated a bit, but nothing was ever allowed to be serious, more “we’re friends who have dinner or see movies or sleep together” than boyfriends. They didn’t meet my kids, we didn’t spend Thanksgivings or Christmases together, etc.
In 2009, I ran into a high school friend. He was having a rough time, financially and emotionally… Recently divorced, had to declare bankruptcy due to his ex-wife’s gambling habit, dated one person right after his divorce who apparently treated him like crap and then dumped him for another guy. With the intention of just offering him emotional support, I began inviting him to casual hang-outs with my group of friends, or “hey, meet me at ??? after work and I’ll buy you a drink.” That sort of thing. Within a couple of weeks, we were dating, and I was deeply, truly in love. He met my family, including my kids (and that’s a big, huge deal to me,) I met his family, and we discussed marriage as an “It’s gonna happen one day” thing - just understood, no doubt about it, just no wedding date set.
When I learned that I was pregnant (holy crap Batman! I wasn’t supposed to be able to have more, and he was never supposed to be able to father a child!), we mutually decided that we would go ahead and tie the knot - not because of any stigma about an out-of-wedlock child, but because that made the most sense emotionally, financially, and legally. There has never been one doubt in my mind that I did the right thing in this situation.
Take-away advice? Get some counseling for your trust issues, don’t get married just because there’s a baby on the way, but don’t avoid marrying because you haven’t learned to trust again. If you don’t trust HIM, though, don’t marry him, regardless of your co-parenting situation…