Cost basis and capital gains exclusion on sale of property