You will file as resident.
You are considered a nonresident for five calendar years on an F1 visa. that is 2016 to 2020.
Since you satisfied the substantial presence test in 2021 you file as resident.
Click on the link for more information
F1 visa and residency