Primary Home and Rental Property

I purchased a duplex this year under a primary home loan however I live in one of the units and rent out the other unit. I read online that you can deduct the closing costs on a rental property such as: inspection fees, mortgage fees (loan application, underwriting fees), title company fees (escrow fees, recording fees, transfer tax, title search) for a rental property but not a primary home.

 

Can you help me understand if I can still deduct these closing costs? No? Yes? If yes, I am assuming I can deduct half of the total amount since only 1 unit is rented out?