After you file

you can claim him as a qualifying child if all these tests are met
• he has had the same principal abode as you for more than ½ the tax year. Temporary absences like for school are ignored
• if he is not a full-time student, he's under 19 at the end of the tax year. If a full-time student, he's under 24 at the end of the tax year.
• he hasn't provided over ½ his own support
• he didn't file a joint return unless there was no tax liability but 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
• his gross income for 2021 was less than $4,300
• you provided over ½ his support
• he isn't a qualifying child of another taxpayer

 

if your ex meets the qualifying child tests then you need a signed form 8332 from him to legally claim your son