The present gerund allows us to indicate that two actions with the same subject are taking place at the same time. It is always introduced by the preposition "en" and it is invariable.
The basic rule for constructing the present gerund is to take the verb in the first person plural of the present indicative and replace the ending "-ons" with "-ant" and then add the preposition "in" in front of the verb.
Il est venu en chantant.