I am canadian citizen working in US on a TN Visa.
I just got laid off recently.

1. How long do I have before I have to leave USA? (What is the grace period?)

2. Do the CBP know when I left USA when I leave by road? (I ask because when I leave by road there is no record online of when I leave USA and enter Canada in the I 94 website, even though there is record of entering into USA)

3. Can I get unemployment insurance in Canada even though I have not filed my taxes in Canada for last few years?

1. 60 days or until the end of your I-94, whichever is SOONEST.
2. They may, but YOU are supposed to hand in a copy of your I-94 to the CDn border guard as you leave, when you are no longer holding the current status.
3. Yes, once you return to Canada. Likely you would claim from the state your worked in.
There is a Service Canada webpage for this: https://www.canada.ca/en/employment-soc ... anada.html