Can someone tell me how can I distinguish between gerunds and participiples since they are very similar.
Gerunds function as objects and subjects. If a word ending in -ing doesn't function as an object or as a subject, then it's a present participle. Here's a trick: First look for the subject and the object(s), if one of those words ends in -ing, then you're dealing with a gerund; if none of those words end in -ing, then you're dealing with a present participle.
Subject: Running is fun.
Object of a Verb: I like running.
Object of a Preposition: About running a company, do you know how?
Note, A gerund can have its own object:
Running a company is difficult.
Part of a Verb: Max is running right now; Max has been running for years.
Adjective: Max is a running man. (Test: What kind of man? A running man.)
Here's how to tell whether the -ing word is a gerund or a present participle in the following nominal contexts:
Running a company (Gerund + its object)
a running man (Present Participle, Adjective + noun)
The adjective comes between the article ('a') and the noun ('man'), whereas the gerund comes before the article and the noun ('a company').