You might be confusing this with using money from an IRA for a down payment on a house. If you are under 59 1/2 and take money from a traditional IRA (not a 401k) to make a down payment on a home, the 10% early withdrawal penalty is waived on the first $10,000 although the distribution itself is taxable. There is no such rule for selling stock to purchase a home.