The custodial parent is the parent with whom the child lived for the longer period of time during the year. However, the child will be treated as the qualifying child of the noncustodial parent if the special rule for children of divorced or separated parents (or parents who live apart) applies.