Yes. A capital gain on a second home is taxable by the state in which the property was located, whether you are a resident of that state or not. In fact, many states require a non-resident seller to make an estimated state tax payment at the time of closing.