The difference is only in likelihood. You will certainly die one day so a simple "If I die" doesn't make sense.
If I die while my children are still under 18 (or whatever the age of majority is where you are), you will have to take care of them.
If I were to die while my children are still under 18, you would have to take care of them.
Both of your sentences are grammatically possible (although you need a comma after "died" in the second).