You can't build houses on top of parcel lines (pre-made land plots made to make property management easier for the government and to avoid this very situation). Before you can build a house the government has to come and survey the land. If the proposed location sits on top of a parcel/tax jurisdiction line, they won't grant the build permit and will most likely just ask if you'd relocate x meters that way.
If your house is built on top of a parcel line, your residency is dictated by the location of your bedroom.