The canonical domain version is the single chosen form of the address to which all the others are redirected. There are commonly four combinations – with and without the www prefix, in secured and unsecured form – and if all of them are accessible, from a search engine's point of view this amounts to four websites with the same content. Signals get split and nothing works at full strength. The solution is simple and one-off: choose one version and permanently redirect the others directly to it, not through a chain of redirects. Apply the same rule to the trailing slash in addresses and to letter case. Check that all internal links, sitemaps and analytics settings use the chosen version, otherwise the problem comes back through the back door.
See also: Redirect chains, HTTPS and mixed content, URL parameters.