Per IRS Publication 17 Your Federal Income Tax, starting on page 27:
To meet this test, your child must have lived with you for more than half the year. There are exceptions for temporary absences, children who were born or died during the year, kidnapped children, and children of divorced or separated parents.
Temporary absences. Your child is considered to have lived with you during periods of time when one of you, or both, are temporarily absent due to special circumstances such as:
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the document at the time it is accessed.