Deductions & credits

You can make it your Principal Residence and likely qualify for an exclusion.  However, because it was not always your main home, the exclusion will be prorated.  So you won't be able to exclude all of the gain; part of it will be taxable.