He must be a US citizen, resident alien or national or a resident of Canada or Mexico.
Then you can claim him/her as a qualifying child if all these tests are met
1) If a full-time student, he's under 24 at the end of the tax year. (full-time means he attended school – (online courses and correspondence schools don’t count) during any part of five calendar months during 2024).
if he's away at school he's deemed to be living with you
2) he hasn't provided over ½ his support
3) he didn't file a joint return unless there was no tax liability but is merely filing jointly to facilitate a refund of taxes withheld or estimates paid
or you can claim him as a qualifying relative if all these tests are met
a) his gross income for 2024 is less than $5,050
b) you provided over ½ his support)
support includes amounts spent for food, lodging, clothing, education, medical and dental expenses, recreation, transportation and other necessities
Turbootax should take you through these questions (and others) when you do the dependent worksheet.