In New York, as in most other states, a person can be deemed a resident either by being domiciled in the state or by maintaining a residence in the state for most or all of the year and spending the requisite number of days in the state.
FORBES: Gimmie Shelter. Would Owning a NY Apartment in Trust Avoid the Statutory Resident Trap? Not Likely.