I'm sorry for your loss. You can claim the baby as a dependent for the entire year provided a certificate of *live* birth was issued. (If the baby was stillborn and no certificate of live birth issued, then you have no claim unfortunately)
When filling in the dependent information there will be a checkbox on one of the screens for "Passed away in 2017" Make sure you select that box and enter the date of his passing below that.
Finally, you most likely do not have an SSN for the baby. That means you can not e-file your return if you desire to take the exemption. You will have to print it, sign it and mail it to the IRS. On the screen that asks for the baby's SSN, enter the word DIED in all caps, and then you can continue to the next screen.
If the child was born AND died in 2017, then you need to file by mail and attach copies of birth and death certificate or other medical records showing the child was born alive and then died.
Opus_17, it's my understanding that based on the b-day and the "passed away in 2017" selections, this information is now included in the instruction sheet that prints when you select the "Print and Mail" option. Not sure about that though, as I don't recall ever getting any confirmation of that from a TT employee.
The IRS instructions have always said to attach medical records. Did that change? Even if turbotax prints a written statement for the customer, they may still have to attach copies of medical records.
was a SSN issued? if so, you can list the dependent, and without any other special action, your return should be approved.