Deductions & credits

Does this only apply to your main home? Can I take the credit for doing it on my second home?