The results of a search for direct pair production of top squarks in events with two opposite-charge leptons (electrons or muons) are reported, using 36.1fb-1 of integrated luminosity from proton-proton collisions at s=13 TeV collected by the ATLAS detector at the Large Hadron Collider. To cover a range of mass differences between the top squark t~ and lighter supersymmetric particles, four possible decay modes of the top squark are targeted with dedicated selections: the decay t~→bχ~1± into a b-quark and the lightest chargino with χ~1±→Wχ~10 , the decay t~→tχ~10 into an on-shell top quark and the lightest neutralino, the three-body decay t~→bWχ~10 and the four-body decay t~→bℓνχ~10 . No significant excess of events is observed above the Standard Model background for any selection, and limits on top squarks are set as a function of the t~ and χ~10 masses. The results exclude at 95% confidence level t~ masses up to about 720 GeV, extending the exclusion region of supersymmetric parameter space covered by previous searches.