Some of my random thoughts ...
To minimize (not avoid), buy in a discretionary trust, wait until your other income is minimal (ie. retirement), wait until any children are of adult age, stagger sales over multiple years, then distribute the gains amongst as many low income beneficiaries as...