Retirement tax questions

So to conclude, I have 29k I can withdraw with any penalty or taxes even thought the account is not 5 years old and Im not 59.5? Those only apply for the earnings? The reason I ask is because I may have to buy a roof soon as my insurance only covering repairs not replacement and it's going to be from 10k to 15k.