Using a subtree filter, this will select some part of your model and return everything at that point and below it in the tree. RFC 6241 does give a number of examples of subtree filtering. One thing about subtree filtering is that it returns everything, and doesn't give you additional selection criteria to decide what to return. This is one of the examples in RFC 6241, where everything below "users" in the model will be returned:

Now the alternative to subtree filtering is to use an XPath filter. XPath can be used to select what is to be returned. Your XPath filter should return a node-set, that is select items in your model that match the criteria you express in XPath filter. Again using the example in RFC 6241, if you wanted to select the entry in your list of users whose name is 'fred', you would use the following XPath filter:

One thing about subtree filtering is that it returns everything, and doesn't give you additional selection criteria to decide what to return.

As defined in the NETCONF RFC (6241), the subtree filtering feature supports content match nodes which allows only some or all of its sibling nodes to be returned. There is an example in section 6.4.5 of the RFC which shows how the subtree filter can be used to select only a subset of a subtree:

Can you please explain with examples in which scenario we need to use 'x-path' filter and when to use 'sub-tree' filter.

Which one to use depends on your use case. Support of XPath is an optional capability. With subtree filtering, only a small set of filters for inclusion, simple content exact-match, and selection is provided, which allows some useful, but also very limited, selection mechanisms as compared to XPath. Section 6 of the NETCONF RFC (6241) has a very good description on what is supported by subtree filtering along with examples. You can find reference material on XPath from the NETCONF RFC.