You would be a student for 5 months- if you are enrolled as a full-time student during any part of a month (even one day).
You are a full-time student for 2021 if during any part of any 5 calendar months during the year you were enrolled as a full-time student at an eligible educational institution, or took a full-time, on-farm training course given by such an institution or by a state, county, or local government agency.
You do not need to meet the 5 month rule to claim an education tax break. You just need to be half time or more for one term. So, for example, if your school is on the quarter system and you only attended Sep-Dec, you can still claim a tuition credit or deduction.
The requirement to be a full time student for parts of 5 months only refers to the ability of your parents to claim you as a "qualifying child" dependent.
There are two types of dependents, "Qualifying Children"(QC) and standard ("Qualifying Relative" in IRS parlance even though they don't have to actually be related). There is no income limit for a QC but there is an age limit, student status, a relationship test and residence test.
A child of a taxpayer can still be a “Qualifying Child” (QC) dependent, regardless of his/her income, if:
He is under age 19, or under 24 if a full time student for at least 5 months of the year, or is totally & permanently disabled
He did not provide more than 1/2 his own support. Scholarships are excluded from the support calculation
He lived with the parent (including temporary absences such as away at school) for more than half the year