Gerunds in a sentence functions as a noun. Hence in a sentence, a gerund will act as direct objects, subjects, subject complements, an object of prepositions or indirect objects. Every gerund ends in -ing, and so does present participles. On the other hand, present participles act as modifiers or complete progressive verbs.
On the other hand, infinitive verbs are formed by adding 'to' to the base form of the verb. for example, to eat, to sleep etc.
Therefore, on revising the sentence by replacing the infinitive 'to sail' with the gerund form of the verb will be written as,
The laughing boy in the boat likes sailing.