There might be a confounder though, with the causality working backwards.
Rural housing is way cheaper than urban housing.
Urban cultural offering is way more lively than rural cultural offering.
If you want kids you need space, and have no time for fun, so you optimize. You stop paying for cultural offering you don't need, and opt for cheaping housing you do need.
Doesn't mean that urban/rural life makes you have children, rather the opposite. The choice in having children dictates whether you choose rural or urban life.
Not saying it's like this, just offering an alternative theory.
From my observations, its more the friends that never left rural village we grew up in that have children. My urban friends don't really have children maybe because urban life i stressed but you also have so much stuff to do so maybe kids isn't really a thing one think about, it's more about building up a network.
For me it's different. For one it's like you said: friends that never left the rural areas have kids more often.
But also friends that I grew up with in urban environments, left to rural environments around the time of having kids. Those that didn't, stayed.
It seems that those who preferred to spend more for the cultural offering of the city stayed and optimised their time to enjoy that cultural offering by not having kids (bars, cafes, museums, hobbies, sports, travel, career).
While those that preferred family life, chose to optimize for that by moving to a place where housing was more affordable, allowing less time spent on career, more time spent on family.
Rural housing is way cheaper than urban housing.
Urban cultural offering is way more lively than rural cultural offering.
If you want kids you need space, and have no time for fun, so you optimize. You stop paying for cultural offering you don't need, and opt for cheaping housing you do need.
Doesn't mean that urban/rural life makes you have children, rather the opposite. The choice in having children dictates whether you choose rural or urban life.
Not saying it's like this, just offering an alternative theory.