The gross amount before tax withholding would be what the penalty would be assessed on. Although early distributions from an IRA may qualify for an exemption from penalty if you are terminated and suffer economic hardship, that does not apply to early distributions from a 401-K plan.
After you enter your Form 1099-R in TurboTax, you will see a list of reasons to exempt the distribution from penalty on the screen that says These Situations May Lower Your Tax Bill:


You can read through the list, especially where it says Learn More next to Other Reason to see if your distribution would qualify for exception to the penalty
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"