Deductions & credits

I would like to know for my case too.

I moved to the US in August 2018 on F1 visa and moved to Canada in first week of June 2023.
While on OPT, I worked full time in the US (OPT-compliant) from February 2021 until I left.
For my entire time in the US, I was on F1.

I was told by a couple of tax consultants that I could have been a non-resident for 2023, considering the 5 exempt years (2018-2022) and less than 183 days in 2023.

I would like to confirm if this is right, so that I might consider amending the 2023 US tax return.