The formal criteria are that a country is a stable market democracy, other than that accession is really a political matter (see Ukraine and Turkey). Clearly there would be a groundswell of support for incorporating a Scotland fleeing from Brexitland. It would be a coup for the EU.