Thanks for your question.
No, unfortunately, there is no exception for avoiding the 10% early distribution penalty if you are going to use the funds to purchase a home. You may be able to withdraw the money under a hardship distribution but then it would still be subject to the penalty.
You may want to consider taking a loan from your 401k plan if you are still employed and they offer that feature. Most plans allow you to take up to 50% of your vested account balance as a loan. You would repay through salary deductions. This is the only way to avoid that penalty.
Hope this helps,