The AMS-02 detector is a general purpose particle physics detector installed on the International Space Station to perform a unique long duration mission of fundamental physics research in space. The detector is operating at an altitude of 400 km, detecting cosmic rays in the GeV to TeV range, before they interact with the Earth atmosphere. The main goals of the experiment include the precise measurement of the cosmic rays fluxes, the search for primordial antimatter and indirect search for dark matter, as well as the study of the cosmic rays propagation. We present the measurement of the positron fraction from 0.5 to 500 GeV, based on 10.9 million events. This measurement is currently exploring the highest energy ever achieved: it can be seen, for the first time, that above 200 GeV the positron fraction is no longer dependent on energy. Moreover, within the sensitivity of the detector, the positron fraction is isotropic. The electron and the positron flux are also shown as a function of energy. They are different in magnitude and their spectral indices are different. Moreover, they both cannot be described by a single power law. The combined electron plus positron flux, from 0.5 to 1 TeV, is also presented, being compatible with a single power law.