Details are explained in this section: https://docs.mendix.com/refguide/reference-selector/#xpath-constraints
Using this domain model
For creating a new person, you can set up the selectable objects for reference selectors.
In this example, the selectable State MUST be associated to the same Country that you first selected for this person.
Thanks for your comments, I have one more question: How should I create a city and I want to add the same hierarchy? I would like to choose the country first, then the state, and then create the city.