I want to add that I'm a Canadian citizen.
If you're living long term in Canada, your employer should have a tax entity in Canada and issue a T4. If you're working in a US resident capacity as a Canadian (i.e. TN or H1B visa), US and Canada have a tax treaty so that you should not be double-taxed, but that assumes you live in US (and all visa-related fine print applies).
If you're getting a W-2 and plan to live in Canada for more than 183 days in a year, then you'll probably want to talk to a tax lawyer and an immigration lawyer (preferably together w/ your employer) beforehand to avoid getting yourself and your company into trouble. What this scenario boils down to is that you cannot legally take an american job without proper work authorization as a foreigner, or you might run into issues with USCIS (e.g. being barred from entry into the US in the future). IIRC visas have even more restrictions on where you can work and how long you can live elsewhere, so I'd say if you plan to live in Canada longer than 30 days, you probably should figure this stuff out beforehand.
There’s a tax treaty so you’ll get credit for any taxes paid in another country and only have to pay the difference.
But you would have to file to recover any taxes withheld or consider them as foreign taxes paid when filing in Canada. Canadian taxes are higher than the us so you should not end up paying the us anything.