(Abridged) Long gamma-ray bursts (LGRB) have been suggested as promising tracers of star formation owing to their association with the core-collapse of massive stars. 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. We perform 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 compare 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. We find that, similarly to z < 1, LGRBs do not directly trace star formation at 1 < z < 2, and they tend to avoid high-mass, 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+logOH ~ 8.55. Metallicity rules the LGRB production efficiency, which is stifled at Z > 0.7 Zsun. Under this hypothesis we can expect LGRBs to trace star formation at z > 3, once the bulk of the star forming galaxy population are characterised by metallicities below this limit. The moderately high metallicity threshold found is in agreement with the conditions necessary to rapidly produce a fast-rotating Wolf-Rayet star a in close binary system, and could be accommodated by single star models under chemically homogeneous mixing with very rapid rotation and weak magnetic coupling.