One of the most widely researched topics in Extragalactic Astrophysics in the last decades is how early-type galaxies have formed their stars and assembled. In this context, we now have unequivocal observational evidences about the existence of a numerous population of massive galaxies which not only had assembled a considerable amount of stars ( 10^11 M_sun) by z 2, but were already evolving passively by that time. These galaxies, the likely progenitors of nearby ellipticals, are also quite compact in comparison with local galaxies of the same mass. These result are mainly based on measurements designed to obtain stellar masses and sizes, and our estimations of these parameters are now quite robust. Now we need a more secure determination of how exactly they formed and assembled their stellar mass in just 2-3 Gyr (z>2). In other words, how was their Star Formation History and which are the properties (age, metallicity, dust content) of their stellar populations ? And how could they end up with such high masses and small sizes ? In this talk, we will present our results about the SFH (mainly ages and duty cycles) of massive galaxies at z=1-3 based on the deepest spectro-photometric data ever taken. These data were gathered by the Survey for High-z Absorption Red and Dead Sources (SHARDS), a ESO/GTC Large Program aimed at obtaining R 50 optical spectra of distant galaxies. This resolution is especially suited to measure absorption indices such as D(4000), Mg_UV, the Balmer break,etc.. for galaxies up to z 3 (merging our SHARDS data with HST/WFC3 grism observations) or emission-line fluxes for faint targets up to z 6. These measurements represent a big step forward for the robust determination of the stellar population properties, providing a much more certain characterization of the stellar content of distant galaxies than the typical broad-band studies. Our results uniquely allow to study the stellar content of red and dead galaxies at z 2 and identify progenitors at higher redshifts, as well as helping to constrain the models of galaxy formation.