Selling your home can trigger capital gains taxes, but there are ways to reduce or eliminate your bill, experts say. Here’s what to know.