Retirement tax questions

Good question which can only really be answered by doing a test return to see how it works out ... it is a $ for $ credit against the federal tax liability BUT NOT the early withdrawal 10% penalty if you are under the age of 59 1/2   ....  for instance if the solar cost is $30K then the credit would be $9K  & if you take the $30K out of your 401K the taxes at 24% would be $7200 so the $9K credit would cover it but not any penalty ($20K x 10% = $3K)