The 10% penalty doesn't apply to a "qualified first-time homebuyer distribution" from an IRA (section 72(t)(2)(F)) if the distribution is used within 120 days of its receipt to pay qualified acquisition costs associated with the first-time purchase of a principal residence. The homebuyer may be the IRA holder or spouse, child, grandchild or ancestor (section 72(t)(8)(A)).
The term principal residence means the same as it does for calculating the excludability of gain on sale under section 121 (section 72(t)(8)(ii)).
Section 72(t)(8)(C) defines qualified acquisition costs to include the expenses of acquiring, constructing or reconstructing a residence, as well as any usual or reasonable settlement, financing or other closing payments.
Please note that the term first-time homebuyer is a misnomer in that it does not preclude previous home ownership. Instead, it holds that the homebuyer (and spouse, if married) cannot have had an ownership interest in a principal residence during the two-year period ending on the date of acquisition (section 72(t)(8)(D)(i)(I)).
So as long as the $10,000 is used to pay for the downpayment and closing costs on a home and that you had not owned a principal residence within the past two years, and it is done within 120 days of the withdrawal from the IRA, you can use the funds without paying the 10% excise tax for early withdrawal.
I hope this helps! If you have any more questions, just ask away!