Primary residency is determined by the time period you stay somewhere, as well as your intention of staying somewhere for an indefinite time.