We're not talking about July 2018 to the following spring. It's about the tax year 2018, which he was in the U.S. for the majority of.
Doesn't matter, the number of days is the second test of residency.
The first test - where are you resident on December 31 2018. If its Canada you pay tax on your worldwide income for all of 2018. That includes salary paid by leafs, signing bonus and even the 2018 portion of his 2017-18 contract with the Islanders. Then the tax treaty with US ensures you get credit for any tax already paid in US so not double taxed. (i.e Cdn tax bill is 5M but I paid 3.5M already in US, then I only pay the additional 1.5M here)
The number of days test applies to someone like Matthews who as an American and can main sufficient ties to US to be considered an American resident (stronger ties to US) so not resident in Canada on December 31. Despite not meeting the 1st test, he would be a deemed resident of Canada if he spent more than 183 days in Canada in the calender year and subject to same taxed on world=wide income.
For JT no days not relevant, it is was he resident on Dec 31. Did he own a home here?, did he work here? have cdn bank accts investments, cdn drivers license health card etc. if yes a long with being born here he is probably resident here and will likely lose this case.
Where JT may have really screwed himself is if he paid tax in US on the 15M bonus already, he may not be able to amend that return to not declare it there at this late stage. he may not get the FTC for what he paid already to offset cdn tax as in CRA's view its not foreign income- it was earned here.
I used to work with a tax practioner who had an expression when we were too aggressive on our tax planning- Pigs get fat, Hogs get slaughtered. JT went whole Hog on this one I think
Edit: if he was previously a resident of The US while there its possible that he can be resident of Canada for a part of the year. I.e if the tests say resident in Canada on Dec 31 then he is taxed on worldwide income earned after the date he became resident of Canada. That date may be a point of legal argument. For what is worth here is a summary of how residence is determined in layman terms
Generally, an individual is resident in Canada for tax purposes if there is a continuing relationship between the individual and Canada. In determining an individual's residence, all relevant facts must be considered.
Residential ties of particular significance include the maintenance of a dwelling place available for the individual's occupation and the residence of the individual's spouse and dependants. Ordinarily, individuals are considered to be resident where they maintain a fixed abode for themselves and their families. Secondary factors include social and business ties and personal property, such as memberships in clubs and religious organisations, driver's licences, vehicle registration, and medical insurance coverage.