You can count maternity leave towards PR if you were employed at time you went on maternity leave, as long as the break in employment isn't longer than 12 months. If, at the end of the 12 months, you can show evidence of job seeking, that should also count.

If you were self-employed and remained self-employed for that year, you may be accepted as continuing in self-employment, but may have to provide further evidence if your earnings for that year were exceptionally low.

In the case of St Prix v DWP, the ECJ found that a woman who gives up work, or seeking work, because of the physical constraints of the late stages of pregnancy and the aftermath of childbirth, retains the status of ‘worker’ under EU law.

See: St Prix v DWP