We present an X-ray stacking analysis of ~75000 star-forming galaxies between 0.1<z<5.0 using the Chandra COSMOS-Legacy survey to study the X-ray emission of low-luminosity active galactic nuclei (AGN) and its connection to host galaxy properties. The stacks at z1.3 exhibit a significant X-ray excess indicating nuclear emission. The AGN emission is strongly correlated with stellar mass but does not exhibit an additional correlation with SFR. The hardness ratios of the high-redshift stacks indicate that the AGN are substantially obscured (N_H_~10^23^cm^-2^). These obscured AGN are not identified by IRAC color selection and have L_X_~10^41^-10^43^erg/s, consistent with accretion at an Eddington rate of ~10^-3^ onto 10^7^-10^8^M_{sun}_ black holes. Combining our results with other X-ray studies suggests that AGN obscuration depends on stellar mass and an additional variable, possibly the Eddington rate.