Wow...I know what it's like to make mistakes.
Your husband was too easy on you the first time or you would have changed. If you accepted responsibility and made changes the first time it wouldn't have happened again.
If he takes you back it will happen a third time because something is wrong inside of you. I know because I've had to change the way I think to overcome my issues.
You need to show him you are working on yourself. This will take time. You need to go to counseling solo for awhile and find out what's going on with you.
You will need to be honest with him about the second time. FULL DISCLOSURE. There is no way to move forward without this.
Let me ask you this...did you have full on sex both of these times and were both times the result of Internet activity?