Gerunds are formed from verbs, but they act as nouns in the sentence. They end in -ing. For example, "Swimming has always been my favorite activity." In this sentence swimming is the subject and acting as a noun. In the sentence "We were swimming in the lake." The word 'swimming' is being used as a verb, so it is not a gerund.
However, the infinitive of a verb is its base form and often includes 'to' in front of it. For example, to swim