Sorry about your personal loss. The settlement is tax free to you because it is compensation for personal physical injury. However, if any part of the settlement is for punitive damages, those are taxable.
On a sale of a principal residence, you may avoid tax under the rules.