You should have 5 years legal residence. But lately its the trend that UKBA is granting citizenships to people who may have been illegal. I know of dozens of people who recently got citizenship, and they were illegal for 10-15 years and got their ILR outside the rules in past year or so. Failed asylum seekers who have been granted ILR under legacy exercise are also being granted Citizenship on a regular basis now. Door seems to be open now, so get in quickly if you want.