Measurements of the He-3 and D components in cosmic rays with the AMS-02 experiment