can you sell stock to purchase your primary residence, tax free

selling stock to purchase home, capital gains tax to pay