If you every worked with TreeList field type you know its limitation. TreeList Source field accepts DataSource or query in format presented in example below:

DataSource=/sitecore/content/home/&IncludeTemplatesForSelection=Temp Name

or

query:self::

I had two problems with that field when I was working. First is the lack of being able to specify multiple routes, because TreeList can have only one root node. That problem can be solved using Kam Figy solution here. But it didn't solved my problem because I also needed support for query. I had to display two root nodes where first was in fixed location and second depended on context and I also needed support for inclusion and exclusion criteria for both of my routes. I used Kam's example and changed it slightly.

namespace Xxx.Core.SitecoreExtensions
{
    using System;
    using System.Linq;
    using Sitecore.Data.Items;
    using Sitecore.Diagnostics;
    using Sitecore.Globalization;
    using Sitecore.Shell.Applications.ContentEditor;
    using Sitecore.Text;
    using Sitecore.Web;
    using Sitecore.Web.UI.HtmlControls;
    using Sitecore.Web.UI.WebControls;
    public class MultiRootTreeList : TreeList
    {
        private const String QueryKey = "query:";

        private String ExtractQuery(String value)
        {
            return value.Substring(QueryKey.Length);
        }

        protected override void OnLoad(EventArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            base.OnLoad(args);

            if (!Sitecore.Context.ClientPage.IsEvent)
            {
                var existingTreeView = (TreeviewEx)WebUtil.FindControlOfType(this, typeof(TreeviewEx));
                var treeviewParent = existingTreeView.Parent;

                existingTreeView.Parent.Controls.Clear();
                var dataContext = (DataContext)WebUtil.FindControlOfType(this, typeof(DataContext));
                var dataContextParent = dataContext.Parent;

                dataContextParent.Controls.Remove(dataContext);

                var impostor = new Sitecore.Web.UI.WebControls.MultiRootTreeview();
                impostor.ID = existingTreeView.ID;
                impostor.DblClick = existingTreeView.DblClick;
                impostor.Enabled = existingTreeView.Enabled;
                impostor.DisplayFieldName = existingTreeView.DisplayFieldName;

                var dataContexts = ParseDataContexts(dataContext);

                impostor.DataContext = string.Join("|", dataContexts.Where(x => x != null).Select(x => x.ID));
                foreach (var context in dataContexts)
                {
                    if (context != null)
                    {
                        dataContextParent.Controls.Add(context);
                    }
                }

                treeviewParent.Controls.Add(impostor);
            }
        }

        protected virtual DataContext[] ParseDataContexts(DataContext originalDataContext)
        {
            return new ListString(DataSource).Select(x => CreateDataContext(originalDataContext, x)).ToArray();
        }

        protected virtual DataContext CreateDataContext(DataContext baseDataContext, string dataSource)
        {
            DataContext dataContext = new DataContext();
            dataContext.ID = GetUniqueID("D");
            dataContext.Filter = baseDataContext.Filter;
            dataContext.DataViewName = "Master";
            if (!string.IsNullOrEmpty(DatabaseName))
            {
                dataContext.Parameters = "databasename=" + DatabaseName;
            }
            if (dataSource.Contains(QueryKey))
            {
                Item contextItem = Sitecore.Context.ContentDatabase.Items[ItemID];
                Item dataSourceItem = contextItem.Axes.SelectSingleItem(ExtractQuery(dataSource));
                if (dataSourceItem == null)
                {
                    return null;
                }
                dataSource = dataSourceItem.Paths.FullPath;
            }
            dataContext.Root = dataSource;
            dataContext.Language = Language.Parse(ItemLanguage);

            return dataContext;
        }
    }
}

Now all you have to do is to update FieldTypes and Azure Search configs (optional see Azure Search Config)

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <fieldTypes>
      <fieldType name="MultiRootTreeList" type="Sitecore.Data.Fields.MultilistField,Sitecore.Kernel" patch:after="fieldType[@name='Treelist']" />
    </fieldTypes>
  </sitecore>
</configuration>
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <contentSearch>
      <indexConfigurations>
        <defaultCloudIndexConfiguration type="Sitecore.ContentSearch.Azure.CloudIndexConfiguration, Sitecore.ContentSearch.Azure">
		  <fieldMap type="Sitecore.ContentSearch.Azure.FieldMaps.CloudFieldMap, Sitecore.ContentSearch.Azure" >
			<fieldNames hint="raw:AddFieldByFieldName">
			  <field fieldName="all_templates" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.Collections.Generic.List`1[[System.String, mscorlib]]" settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure" >
				<Analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" />
			  </field>
			  <field fieldName="has_presentation" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.Boolean" settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure" />
			  <field fieldName="has_search_result_formatter" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.Boolean" settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure" />
			  <field fieldName="search_result_formatter" storageType="YES" indexType="UNTOKENIZED" vectorType="NO" type="System.String" settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure" />
			</fieldNames>
			<fieldTypes hint="raw:AddFieldByFieldTypeName">
			  <fieldType type="System.String[]" fieldTypeName="multiroottreelist" boost="1f" searchable="YES" retrievable="YES" facetable="YES" filterable="YES" sortable="NO" settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure"/>
			</fieldTypes>
		  </fieldMap>
		  <fieldReaders type="Sitecore.ContentSearch.FieldReaders.FieldReaderMap, Sitecore.ContentSearch">
			<mapFieldByTypeName hint="raw:AddFieldReaderByFieldTypeName">
			  <fieldReader fieldTypeName="multiroottreelist" fieldNameFormat="{0}" fieldReaderType="Sitecore.ContentSearch.FieldReaders.MultiListFieldReader, Sitecore.ContentSearch"/>
			</mapFieldByTypeName>
		  </fieldReaders>
		  <virtualFields type="Sitecore.ContentSearch.VirtualFieldProcessorMap, Sitecore.ContentSearch">
			<processors hint="raw:AddFromConfiguration">
			  <add fieldName="content_type" type="Xxx.Core.Indexing.Infrastructure.Fields.SearchResultFormatterComputedField, Xxx.Core"/>
			</processors>
		  </virtualFields>
		  <documentOptions type="Sitecore.ContentSearch.Azure.CloudSearchDocumentBuilderOptions,Sitecore.ContentSearch.Azure" >
			<fields hint="raw:AddComputedIndexField">
			  <field fieldName="has_presentation" storageType="no" indexType="untokenized">Xxx.Core.Indexing.Infrastructure.Fields.HasPresentationComputedField, Xxx.Core</field>
			  <field fieldName="all_templates" storageType="no" indexType="untokenized">Xxx.Core.Indexing.Infrastructure.Fields.AllTemplatesComputedField, Xxx.Core</field>
			  <field fieldName="has_search_result_formatter" storageType="no" indexType="untokenized">Xxx.Core.Indexing.Infrastructure.Fields.HasSearchResultFormatterComputedField, Xxx.Core</field>
			  <field fieldName="search_result_formatter" storageType="no" indexType="untokenized">Xxx.Core.Indexing.Infrastructure.Fields.SearchResultFormatterComputedField, Xxx.Core</field>
			</fields>
		  </documentOptions>
		</defaultCloudIndexConfiguration>
      </indexConfigurations>
    </contentSearch>
  </sitecore>
</configuration>

Next go to Sitecore add the field type into core database at /sitecore/system/Field types/List Types

enter image description here

Now we can use our new field type with Source specified like this:

DataSource=/sitecore/content/Home/Global Components|query:./Components&IncludeTemplatesForSelection=Component DataSource=/sitecore/content/Home/Settings/|query:./ancestor-or-self::*[@@templatekey='home']/Settings

It is important not to use templatename but templatekey, templatename is case sensitive and for some reason data source comes down in lowercase.