If you have a traditional IRA or Roth IRA you may withdraw up to $10,000 without penalty for a first-time home purchase. You qualify for this if you and your spouse have not owned property for the preceding two years. You have to use the money for the stated purpose within 120 days. If you don't, be sure to deposit it back in an IRA to avoid paying tax and penalties.
You may also withdraw money for a first home for a spouse, child, grandchild or ancestor who has not owned property for two years. But keep in mind that the $10,000 limit is a lifetime limit for you, from all your IRAs combined.
Traditional IRA: Your withdrawal will not be subject to a 10% penalty, but you will have to pay income tax on pre-tax contributions you withdraw, as well as on any earnings. Distributions from traditional IRAs generally include a mix of contributions and earnings, so you can't withdraw only after-tax contributions. That only works with a Roth IRA.
Roth IRA: If you have not yet owned your Roth IRA for five years, your first-time homebuyer withdrawal will be a "nonqualified distribution". This means you will have to pay tax on any earnings you withdraw. You can avoid withdrawing earnings if you do your calculations correctly, because earnings in a Roth IRA are always distributed last. If you have owned your Roth IRA for five years or more, the distribution will be "qualified" so you won't have to worry about paying tax on earnings.
Note: Since the first Roth IRAs were established in 1998, qualified distributions will not be possible for anyone before 2003.