Yes, it can be quite confusing. In fact in the Home Page of this website under the item "Maternity benefits", I did give examples to explain the two clauses, which are as follow:
(2)(a) A female employee shall be entitled to receive maternity allowance for the eligible period from her employer if:
(i) she has been employed by the employer at any time in the four months immediately before her confinement; and
(ii) she has been employed by the employer for a period of, or periods amounting in the aggregate to, not less than ninety days during the nine months immediately before her confinement.
Commentary: Situation No.1, a pregnant woman gives birth after working for an employer for two months, is she entitled to maternity allowance? No, she is not. Although she fulfills condition (i) and not condition (ii) as she has worked for only two month, the law says it must be at least 90 days.
Situation No.2: A long time female employee resigns on 1st January and gives birth on 1st May, is she entitled to maternity allowance? No, she is not. Although she fulfils condition (ii) but she fails to fulfil condition (i) because during the 4 months immediately preceding her confinement she was already not in employment. If she gave birth on 30th April then she would be entitled to maternity allowance.
In your case, you are eligible for maternity allowance because you have fulfilled both conditions. I give another example, another colleague of yours who joined on the same date, resigned on 1 Sept and subsequently gives in say 1 Nov, she is also entitled. But if she gives birth more than 4 months after the date of resignation, then she is not entitled.