The requirement for both legacy Contribution Based ESA and New Style ESA is a minimum of 26 weeks of NI Contributions in one of the two Tax Years 2017-18 or 2018-19 AND at least 50 weeks of NI Contributions or NI Credits in both the Tax Years 2017-18 and 2018-19. There are some exceptions to the First Contribution Condition.
Gordon
Nothing on this board constitutes legal advice - always consult a professional about specific problems