SEO - Canonical url and multilanguage site
<p>Our website is targeting several languages and countries. We make the choice to use subdomain to manage our URLs. We want to avoid to create duplicate content and canonical issues.The content for www. and en. is identical but we plan to adapt the content for en. (in order to target UK).</p>

<p>For main domain, google is understanding:</p>

<pre><code>&lt;link href="https://www.example.com/" hreflang="en" rel="canonical" data-trid="15"&gt;
&lt;link href="https://example.com/" hreflang="x-default" rel="alternate" data-trid="16"&gt;
&lt;link href="https://example.com/" hreflang="en" rel="alternate" data-trid="17"&gt;
&lt;link href="https://en.example.com/" hreflang="en-gb" rel="alternate" data-trid="18"&gt;
&lt;link href="https://fr.example.com/" hreflang="fr" rel="alternate" data-trid="19"&gt;
&lt;link href="https://de.example.com/" hreflang="de" rel="alternate" data-trid="20"&gt; 
</code></pre>

<p>For english subdomain:</p>

<pre><code> &lt;link href="https://en.example.com/" hreflang="en-gb" rel="canonical"&gt;
 &lt;link href="https://example.com/" hreflang="x-default" rel="alternate"&gt;
 &lt;link href="https://example.com/" hreflang="en" rel="alternate"&gt;
 &lt;link href="https://en.example.com/" hreflang="en-gb" rel="alternate"&gt;
 &lt;link href="https://fr.example.com/" hreflang="fr" rel="alternate"&gt;
 &lt;link href="https://de.example.com/" hreflang="de" rel="alternate"&gt;
</code></pre>

<p>What is the best practice to avoid any canonical &amp; duplicate content issues?
Thanks for your help!</p>