Per IRS Pub 17
https://www.irs.gov/publications/p17/ch03.html#en_US_2016_publink1000170876
Death or birth of child.
A child who was born or died during
the year is treated as having lived with you more than half of the year
if your
home was the child's home more than half of
the time he or she was alive during the year. The same is true if the
child lived
with you more than half the year except for
any required hospital stay following birth.
Child born alive.
You may be able to claim an exemption
for a child born alive during the year 2016, even if the child lived only
for a moment.
State or local law must treat the child as
having been born alive. There must be proof of a live birth shown by an
official
document, such as a birth certificate. The
child must be your qualifying child or qualifying relative, and all the
other tests
to claim an exemption for a dependent must be
met.
Born and died in 2016.
If your child was born and died ,
and you don’t have an SSN for the child, you may attach a copy of the
child's
birth certificate, death certificate, or hospital
records instead. The document must show the child was born alive. If you
do this, enter “DIED” in column (2) of line 6c of your Form 1040 or Form 1040A.
[This pub will be updated to 2017 next year]