Claiming a child after they join the military

My son left for military basic training at the end of July 2020 which means he was with me for 7 months of the year.  He turned 19 in November 2020 but was a full-time student for at least 5 months of the year.  Can I still claim him as a dependent?  Does it matter how much he earned from July-December 2020 while in the military?  How will this affect his filing his own taxes/what he gets back?