And I want to recreate this but in the deferred render engine to be able to modify the material color based on where does it receive shadows, but I can´t manage to find any info on how to do this, can someone help me here please?
You would need to modify existing shading model/shadow projection shader or add your own. Shadow information is not accessible during material pass on deferred.