After you file

If they spend the night then it counts as time lived with the other parent,  not you.

More than half the year to the IRS means 184  nights or more (in a leap year - 183 nights in non-leap year) that do not need to be consecutive.

 

See Custodial parent and noncustodial parent in Pub 501

https://www.irs.gov/publications/p501#en_US_2018_publink1000220906

 

**Disclaimer: This post is for discussion purposes only and is NOT tax advice. The author takes no responsibility for the accuracy of any information in this post.**