Once a taxpayer determines that the resulting profits of a real estate property, particularly a residential one, is Capital Gain, many tend to claim it was a principal residence! Principal residence exemption shelters any capital gain resulting from the sale of a house acquired solely for the purpose of inhabiting.
Principle residence exemption does not apply to property flipping.
A tax court decision in November 2017 is available here where the court denied principal residence exemption. In the same case, the court also denied the income to be attributed as Capital Gain.