Source: https://money.stackexchange.com/questions/46403/filing-as-dual-status-or-non-resident-if-entered-and-exited-the-us-in-the-same-y