I don't know if anyone here has read any fiction by J.D. Robb. (Nora Roberts by any other name.) Her series is based around a cop in a futuristic NYC - but not too future. Maybe 75 years from now or so.
I mention this because in her world, she has created "cohab" laws. People can marry (gender notwithstanding - m/f, m/m, f/f ... or any variation thereof) if they choose and want the religious or historical significance of marriage. But people can also get a "contract" for Registered Cohabitation. You can live together w/out it, but if you choose to "cohab" as it's called in her world, you have a certain set of rights and responsibilities. Some of them are mandated by law and some of them are optional and are spelled out in the final contract. That includes legal rights, rights of survivorship, insurance coverage (at increased premiums), etc., etc., etc. This applies not only to couples (again, gender non-specific) but to triads, and quads as well. In the series she has not gone into relationships past triads and quads, but based on how the series is written, I'm sure the permutations would be limitless. You can also be Registered Cohabs with someone w/out actually living in the same house.
(Her world also has legalized prostitution - or as she refers to them: Licensed Companions who also have legal rights, and who are mandated to have testing every so many months and to undergo certain psychological tests to receive and maintain a license. But that's another thread.
Obviously this is a fictional series and it's easy to skim the particulars when you're talking about fiction, but in my perfect world, J.D. Robb's version would be very close to what we'd have.