Depreciation of solar panels is only available for for business property, either your primary home or a secondary home that you live in for part of the year. You could depreciate it if your home or second home was a rental.
The residential energy credit is nonrefundable—if the credit is more than your tax liability, it can be carried forward to next year's tax return. .Also, taxpayers who take the 30% credit for solar energy property installed in their principal residence or vacation home must reduce their basis in the property by the amount of the credit.
Instructions for Form 5695
Form 5695 Residential Energy Credits