best to check on the gov website really. they explain it all on there.
but as far as i know you have to have been employed for at least 26 weeks before the 15th week before your baby is due to get maternity pay (smp) so basically 41 weeks before baby is due (so the whole of the pregnancy plus the week before you got pregnant) if thats makes sense
im not entitled to it because i had 2 different jobs last yr cos i got made redundant and then stopped working the second job (by choice) cos it was to much manual labour when pregnant
but i am entitled to maternity allowance because the rules for that are
you have to have worked for at least 26 weeks in your 'test period' which is the 66 weeks before your baby is due and earned at least £30 a week for 13 weeks of those 26 weeks.
i feel like im really waffling on, i hope u understand, its a bit clearer on the website. lol, just google maternity pay and u'll find it.