Aims. Long gamma-ray bursts (LGRB) have been proposed as promising tracers of star formation owing to their association with the core-collapse of massive stars. Nonetheless, previous studies we carried out at z < 1 support the hypothesis that the conditions necessary for the progenitor star to produce an LGRB (e.g. low metallicity), were challenging the use of LGRBs as star-formation tracers, at least at low redshift. The goal of this work is to characterise the population of host galaxies of LGRBs at 1 < z < 2, investigate the conditions in which LGRBs form at these redshifts and assess their use as tracers of star formation. Methods. We performed a spectro-photometric analysis to determine the stellar mass, star formation rate, specific star formation rate and metallicity of the complete, unbiased host galaxy sample of the Swift/BAT6 LGRB sample at 1 < z < 2. We compared the distribution of these properties to the ones of typical star-forming galaxies from the MOSDEF and COSMOS2015 Ultra Deep surveys, within the same redshift range. Results. We find that, similarly to z < 1, LGRBs do not directly trace star formation at 1 < z < 2, and they tend to avoid highmass, high-metallicity host galaxies. We also find evidence for an enhanced fraction of starbursts among the LGRB host sample with respect to the star-forming population of galaxies. Nonetheless we demonstrate that the driving factor ruling the LGRB efficiency is metallicity. The LGRB host distributions can be reconciled with the ones expected from galaxy surveys by imposing a metallicity upper limit of 12 + log(O/H)∼8.55. We can determine upper limits on the fraction of super-solar metallicity LGRB host galaxies of ∼ 20%, 10% at z < 1, 1 < z < 2, respectively. Conclusions. Metallicity rules the LGRB production efficiency, which is stifled at Z 0.7 Z . Under this hypothesis we can expectLGRBs to trace star formation at z > 3, once the bulk of the star forming galaxy population are characterised by metallicities below this limit. The role played by metallicity can be explained by the conditions necessary for the progenitor star to produce an LGRB. The moderately high metallicity threshold found is in agreement with the conditions necessary to rapidly produce a fast-rotating Wolf-Rayet stars in close binary systems, and could be accommodated by single star models under chemically homogeneous mixing with very rapid rotation and weak magnetic coupling.