Under the new law , co-ops need to pass one of three tests so that shareholders can qualify for tax benefits , including deductions for property taxes and mortgage interest and the right to shield up to $ 500,000 from capital-gains taxes when the apartment is sold .