Hey folks, a question on taxes – if you have no permanent home base and are traveling between US and Canada, but not necessarily spending 6 months or longer anywhere in particular, what ends up being your residency for tax purposes?

Example – say in a given year you spend 4 months in BC, 2 in AB, 1 in AK, and 5 split between WA, OR, and CA. And you are a US citizen / have no permanent status in Canada, working remotely for a US company.

Am I correct in understanding that you’re treated as a resident in Canada for tax purposes if this ends up being 6 months + 1 week? If so, would you pay taxes to a specific province?
If you spend under 6 months in Canada on the other hand, I assume you’re only paying US tax. But then, which state?