Only a distribution from an IRA account qualifies and then up to $10,000 of the distribution will be exempt from any early distribution penalty. All of the distribution will still be subject to income tax and any amount over the $10,000 will still be subject to an early distribution penalty. Other details are listed here:
See here, p. 26
https://www.irs.gov/pub/irs-pdf/p590b.pdf