Reference: IRC Sec 25D and IRS “Residential Property Updated Q&A” [Aug 2016]
The 30% tax credit has been extended for installations completed prior to 12/31/19 for primary residence and second home. (This credit is not available on rentals). From 1/1/2020 through 12/31/2020, the credit is 26%. From 1/1/21 through 12/31/2021, the credit is 22%.
After 12/31/2021, the credit is not available unless extended further by Congress.