Exceptions to the IRA penalty fall into 2 categories
Just for IRAs
First-Time Home Purchase
The 10% early IRA distribution penalty does not apply if you use the distribution to acquire a first home. Acquire means purchasing an existing home or constructing a new one for a primary residence. Closing costs also qualify. The definition of first-time home buyer is someone who has not owned a home for the past two years.
The 10% IRA distribution penalty does not apply if you take an IRA distribution and use it for qualified higher education expenses. Such expenses include post-secondary tuition, fees, books, supplies and required equipment. Computers, computer equipment and internet access are qualified education expenses if used by the students during the years which they are in school.