If he continue to live with you past July 2, you may still claim him as a dependent. The $4150 income test will not kick in until next year (2019).
A child of a taxpayer can still be a “Qualifying Child” (QC) dependent**, regardless of his/her income, if:
1. 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
2. He did not provide more than 1/2 his own support. Scholarships are considered third party support and not as support provided by the student.
3. He lived with the parent (including temporary absences such as away at school) for more than half the year
So, it doesn't matter how much he earned. What matters is how much he spent on support. Money he put into savings does not count as support he spent on him self.
The support value of the home, provided by the parent, is the fair market rental value of the home plus utilities & other expenses divided by the number of occupants.
Furthermore, there is a rule that says IF somebody else CAN claim him as a dependent, he is not allowed to claim himself. If he has sufficient income (usually more than $12.000), he can & should still file taxes. In TurboTax, he indicates that somebody else can claim him as a dependent, at the personal information section. TT will check that box on form 1040.
Even if he had less, he is allowed to file if he needs to get back income tax withholding. He cannot get back social security or Medicare tax withholding.
**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, a relationship test and residence test. Only a QC qualifies a taxpayer for the Earned Income Credit. They are interrelated but the rules are different for each.