Reference this:
https://www.energy.gov/sites/prod/fi...Solar%20PV.pdf
In that guide it specifically states that you can get credits on installations on second homes. It also states that the system does not have to be hooked into the grid.
There is nothing that mentions it HAS to be installed by a contractor although that cost of contract labor can be added to the total cost of the system when calculating the credit.
There may be state credits available to you as well.