Honestly, should there be a condition on this? Like perhaps, the UK is only allowed to rejoin if a referendum is approved by a supermajority of the population? Really. What's to stop the UK from see-sawing again and starting this whole mess all over again? The surest way to prevent that is to require a referendum with 2/3 majority approval. This ensures that EU membership is popular, and thus likely to be more durable. It is hard to get a 2/3 majority on anything.
Or perhaps some other mechanism could be proposed. How do you avoid the risk of the UK just doing this all over again?