Deductions & credits

As a second home the sale will be the sale of a capital asset. If the house was never built and the land subsequently sold it would also be treated as a capital gain. So, is habitability a fair test?