There are various ways to handle this. I arbitrarily chose 1 year, but it could be shorter. It's not clear whether it needs to be a full-time job or just a part-time job. After all, our elected officials tend to spend a lot of time fundraising and campaigning rather than legislating. We could require that companies give unpaid leave, while the citizen legislator gets paid a salary by the government. There would of course be hardship exceptions to postpone serving.
As a society, we actually need to do more to make it the norm that people can temporarily switch their careers off and on again, for various reasons. Having a child is one crucial example.