Claim as a Dependent

Can I claim my son? He graduated in June 2023 from High school. Has lived with me since he was a baby, but in July he left home to join the Navy. So he’s been getting paid by the Navy since July 5th. He was 18 in 2023, turned 19 in December of 2023. Does he do his taxes for his 1/2 year? I’m so confused. Any help is appreciated.