There has been a lot of confusion here led by Tim Farron and others in suggesting it is possible to remain in the EU despite the referendum result.
The flaw here is that a vote was taken.
The majority voted to leave the EU.
Once Article 50 is triggered, the UK will get a divorce from the EU two years thereafter (as set out) unless the EU 27 agree to an extension of time to complete Brexit.
So any deal is subject to this caveat.