You can get Maternity Allowance if you have been working recently or you have stopped working to have a child. You must meet all of the following conditions:
you must have been working for at least 26 weeks in the 66 weeks before the week in which you are due to give birth. It does not matter if these weeks are split up, or if they are not all for the same employer
you do not qualify for statutory maternity pay
you have been earning at least £30 a week on average. This can be from employed work or self-employed work
you must still be pregnant, or have given birth to a live baby, by the start of the eleventh week before the week in which your baby is due, or you must have given birth to a stillborn baby after the end of the 24th week of pregnancy.
Maternity Allowance does not depend on national insurance contributions. You won't have to pay back your Maternity Allowance if you decide not to return to work.