If you buy together, the solicitors draw up what the agreement is on the deed, the problem comes if only one person has bought and the other actively contributes toward the mortgage, which is less common in unmarried couples tbh, young people are a bit more clued up about this now due to a variety of factors, I think both of them own it, so not a problem, as both are liable and will have a record of what the % share is for sale if they invested different amounts at the start.
it’s much easier to get divorced (if you don’t have many assets or kids) than it is to sell/get out of a house.