Medical expenses (unreimbursed expenses over 7.5% of AGI) and the total and permanent disability of the 401k participant/IRA owner are exceptions to the 10% early withdrawal penalty. See Retirement Topics - Exceptions to Tax on Early Distributions
Qualified first-time homebuyers, up to $10,000 is an exception for IRA owners, but not 401k participants.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"