It doesn't sound as though you're resident in Canada for tax purposes, so I don't understand why you're paying any Canadian tax at all. If you're on a US-flagged vessel and you spend the rest of your time in the US, then you're clearly resident in the US for tax purposes. It sounds like you're being issued a W-2 as well, so you simply file a 1040 like every regular American does and notify the CRA you're non-resident for tax purposes.
The IRS is after you because they keep getting W-2s from your employer but you haven't submitted a US tax return.
If you live in Canada it's a bit of a different situation, you file a 1040NR instead and depending on how long you're in the US, an 8840 (if you're there less than 183 days) or an 8833 tax treaty claim as well. You file for a foreign tax credit with your T1 using forms T2209 and T2036. Because Canadian income
taxes are higher you will usually pay some additional tax on top of whatever was withheld in the US, i.e. when you work out your
taxes and your foreign tax credit, the credit will be less than the amount you owe in Canada.
This CRA publication explains some of it:
http://www.cra-arc.gc.ca/E/pub/tg/p151/README.htmlThe substantial presence test isn't all that relevant to Canadians because of the tax treaty, it just alters which paperwork you have to file with the IRS.
For more information read IRS publications 519 and 597. Publication 597 is a bit out-of-date, it doesn't mention the new treaty provisions that allow you to keep your RRSP/IRA if you move to the other country.
Steve.