The exclamation point format is this:

!communityname@instance.name

As an example, mentions should look like these:

!newcommunities@lemmy.world
!communitypromo@lemmy.ca

This is especially relevant when promoting a new community in the aforementioned communities, as otherwise it’s less convenient to visit and join your community. A standard link would take someone off-site to whichever site the community’s on, instead of its copy on their home site.

Forgot to include this key point as I was writing and revising all this:
Include these mentions in your post bodies! Having it in the title of the post alone doesn’t help, as it doesn’t create any link to click or tap through.

p.s. when typing these mentions, the WebUI will try to provide suggestions to autocomplete, select the right one and it should do the trick. App interfaces will vary but should provide some method to do similar in their post/comment editors, either try typing the mention or looking for an exclamation point in the editor and following what the interface offers to help.