OP I helped my ex husband in a similar way because it "felt right" amd I felt mean not to. Marriage went spectacularly wrong. Relationships do, yours might or might not, you just don't know.
Having a kid changes it for me as it is not about protecting your assets but protecting your ability to provide for your kid.
So, you need an agreement that if you split up, you will only pay him his share back if you sell the house, and you and your child can stay living there until such time as you sell it.
"Legal ownership" is just having your name on the land registry entry. Nothing more. It gives you control over blocking a sale or blocking a remortagage for example. You can be a LO and have no interest in the equity. I dont think it makes any difference if he is an LO or not, except that you will need his cooperation to sell/remortgage.
"Equitable ownerhsip" is actually having a share in the asset. You can tailor this is reflact his contribution, including to home improvements (e.g. extensions, new heating, new kitchen, that sort of thing).
So: a trust deed could give him:
- a share which will reflect his input
- you and any children the right to live there until a sale
Putting him on the mortgage will make him equally responsible for payments, so if you are in arrears they can pursue him or you for the full amount outstanding.
If you ever want him to come back off the mortgage, it is a massive pain, but not impossible.