When you are trying to figure out if an -ing word is a gerund, ask yourself, "Can I add the words The Act of to the beginning of the -ing word, and the meaning will not change?"
Eating is fun. >>>>>>THE ACT OF eating is fun. That means the same thing, so eating is a gerund.
Now let's try it with the second sentence to see if it is a gerund:
Learning English, he had a lot of fun. >>>>THE ACT OF learning English, he had a lot of fun. WTF? This makes no sense. It is NOT a gerund, It has to be a participle!
By the way, you could rearrange this sentence and it means the same thing:
He had a lot of fun learning English. Let's try our little test again to see if it is a gerund. He had a lot of fun THE ACT OF learning English. >>>>Nope! It makes no sense whatsoever, so it has to be a participle.
You realize, of course, that our present progressive tense is made up of a form of to be plus the -ing participle?
I am eating pizza.
Seeing the -ing participle as a part of the verb makes it a little more obvious that it is not a gerund.