Just paste in that stanza of text and edit it to suit.
You also then either need a reverse proxy or to follow Set up Let’s Encrypt with multiple domains / redirects to get certs for all of the domains.
See also Setup Multisite Configuration with Let’s Encrypt and no Reverse Proxy. But that needs to get updated to have another line required that you can get from the previous link. I’ve been meaning to update it but haven’t managed