It depends upon the exact terms of the requirement. (And in some jurisdictions such requirements have been held invalid or unconstitutional.)
Usually, the requirement is that your primary residence be located within the jurisdictional limits of the governmental employer. So for a city, it usually means city limits; for a township, within township limits; for a county, within the county limits; etc.

