Is it possible?

Is it possible for two parents with kids from a previous relationship and living an hour away from eachother to even be able to live together?

Legally while still being able to see their child as much as they already do