As stated already, gerunds look like verbs but behave like nouns. Likewise, gerund phrases behave like noun phrases. In practice, this means that gerunds and gerund phrases can be the subject of sentences/clauses or be the subject complement connected to the subject by an auxiliary verb (helping verb). Let’s look at examples of each of these ideas:
Gerund as a subject: Sleeping is hard if you suffer from anxiety.
Gerund phrase as a subject: Being rude to customers won’t earn you many tips.
Gerund as a subject complement: His favorite activity is reading.
Gerund phrase as a subject complement: The thing she hated most about school was getting up early.