I am wondering how the proceeds from the sale of a principal residence are calculated.