Deductions & credits

On a federal tax return you can get the Residential Clean Energy Credit if you paid for the solar panels and the installation on a home.  The home does not have to be your main home.

 

See IRS Form 5695 Residential Energy Credits instructions - https://www.irs.gov/pub/irs-pdf/i5695.pdf

 

Sorry, cannot answer for Massachusetts.