You're entitled to the full credit. This particular section of the tax law does not have a "must be your main home" requirement.
I just purchased a house in Puerto Rico, which is going to be my second home. I am considering a solar panel system. Can I take the credit even when I live in MD? From the reply it looks like I can but want to confirm.