To build a Social media website, all you need is to have "Groups" app, and have a perfect consoled and made website. They have to use extensions like Grammarly to autocorrect or use API to use "autocomplete" functions. They can of course comment, make sure they are not to be approved (use Moderation to moderate unsafe content).
Advertising can be done using Google Ads. The options are explained here5.
To get the community under a custom domain or sub-domain, you can use freenom or any other DNS website so you can get a free one. You need to follow instructions here5 to move the community under your DNS that you own.