This is from H &R Block:
You can claim a dependent for a person who is a qualifying child or a qualifying relative. A qualifying relative can't be a qualifying child.
You can't claim a dependent exemption for a person if you can be claimed as a dependent by another person. If a married qualifying child or married qualifying relative files a joint return, you can't claim that individual's dependency exemption unless their return is only a claim for refund and no tax liability would exist for either spouse if they had filed separate returns. Generally, to be a dependent, an individual must be a U.S. citizen or resident (or resident of Canada or Mexico) for at least part of the year.
What is a qualifying child?
Having a qualifying child may enable you to claim several tax benefits, such as Head of Household filing status, the exemption for a dependent, the Child Tax Credit, the Child and Dependent Care Credit, and the Earned Income Credit. A child is considered to be a qualifying child if the child meets all of the following conditions:
* Relationship The child must be your child or stepchild (whether by blood or adoption), foster child, sibling or stepsibling, or a descendant of one of these.
* Residence The child must live with you for more than half the tax year. Some exceptions apply for children of divorced or separated parents, kidnapped children, temporary absences, and for children who were born or died during the year.
* Age The child must be younger than 19 at the end of the tax year, or younger than 24 if a full-time student for at least 5 months of the year. Children who are permanently and totally disabled at any time during the year qualify regardless of age. If the child is not disabled, the child must be younger than you (and your spouse if you are Married Filing Jointly).
* Support The child can't provide more than half of his own support for the year.
A child is not considered to be your qualifying child, even if the above tests are met, if you are not required to file a tax return and either do not file a tax return or file a tax return solely to get a refund of income tax withheld. So, another person who is unrelated to the child may be able to claim an exemption for the child as a qualifying relative.
If the parents of a child can claim the child as a qualifying child, but no parent claims the child, another person can claim the child as a qualifying child only if that person's adjusted gross income (AGI) is higher than the highest AGI of any parent of the child.
What is a qualifying relative?
A person is a qualifying relative if that person is not a qualifying child and meets the following requirements:
* Gross income The person has gross income of less than $3,650 for the year unless the person is disabled.
* Support test You must have provided more than half that person's support for the year.
* Member of household or relationship test The person must have either lived with you for the entire year as a member of your household or be related to you. Certain relatives are not required to live with you for the entire year.