Deductions & credits

You don't say when it was installed.

 

The credit is claimed when the system is placed in service (installed, inspected, and turned on).  If that was under a previous owner, there is no credit for you as a subsequent owner.  I think if you installed the system in 2021 and purchased it in 2021, you can claim the credit, even though you originally picked the lease option.