What happens at year 8? Will you stay or will you go? sounds like a song…
If you have to go, then the debt service on the purchase and rehab costs probably will be greater than renting. You also have flexibility.
Since you are planning on having kids, the schools and neighborhood will probably outweigh your commuting time in importance. So what I’m saying, is to rent close to work or university now and learn the area. When you have kids, they will be young enough to relocate without school and friends problems. Oh and watch the HOA and MelloRoos fees. This combined with utility costs can have a significant impact on your monthly cash flow.
And the market just may be even more favorable to a buyer in a year or two 😉