I think perhaps you mean 'I did three years of the ten' In which case it means that the person was sentenced to ten years in prison but only stayed there for three years. Prisoners often have their sentences reduced with good behaviour or by working whilst in prison ( depending obviously on the seriousness of the crime) Others may appeal their sentence and succeed in getting it reduced at an appeal. (Or perhaps he escaped!)