Allowing component in Community Builder:
Open your .js-meta.xml file, (ex. myLightningWebComponent.js-meta.xml) and
set isExposed to true. This will expose the component in all orgs and in Lightning App Builder and Community Builder.
Add the targets field in the LightningComponentBundle root with lightningCommunity__Page as a target.
<targets>
<target>lightningCommunity__Page</target>
</targets>
Targets define what type of page you want your component to be added to. lightningCommunity__Page allows the component to be shown on a Community Page. Without this tag, your component would not appear in the Community Builder.
Setting Properties:
Specify what properties the Community Builder can set. First, add another target called lightningCommunity__Default in .js-meta.xml file.
Below the targets, add the following:
<targetConfigs>
<targetConfig targets="lightningCommunity__Default">
<property name="buttonText" type="String" default="defaultText" />
</targetConfig>
</targetConfigs>
Inside targetConfig, we can configure what the Community Builder Property Editor can set in the component. For our component, you’ll notice we added the text of the button to be set by the Community Builder Property Editor.
Note: The property name must match the name of the @api property in the JavaScript file.
Your final .js-meta.xml file should look similar to this:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="myLightningWebComponent">
<apiVersion>45.0</apiVersion>
<isExposed>true</isExposed>
<masterLabel>My Lightning Web Component</masterLabel>
<targets>
<target>lightningCommunity__Page</target>
<target>lightningCommunity__Default</target>
</targets>
<targetConfigs>
<targetConfig targets="lightningCommunity__Default">
<property name="buttonText" type="String" default="defaultText" />
</targetConfig>
</targetConfigs>
<LightningComponentBundle>
To know more, read this very nice article. This will tell you also the benefit of the LWC and how can create and deploy a lightning web component using sfdx command.