My source:
http://www.undergraduate.study.cam.ac.uk/applying/entrance-requirements/gcse-and-a-level-requirements-facts. See the last point under the 'the facts at a glance' section.
And while they very much prefer applicants to do everything right first time, they say that they understand that everyone can have bad days. It's if you have too many bad days that they start to worry. If in doubt, there's currently an active thread called 'Ask Peterhouse!' where an Admissions Tutor from Peterhouse College, Cambridge is answering people's question.
I don't know about LSE (I think they
prefer things to be done at a single sitting) but by 'resitting the whole year', I mean if you're resitting all the AS or A2 (or both) modules for any of your subjects. So, for example, if somebody did really badly on their AS results and wasn't allowed to progress onto A2, they might repeat the AS year doing the same exams next year and do their A2 exams the year after that. This would mean they've completed A-levels in three years rather than two, which pisses them off somewhat.
I asked the Peterhouse Admissions Tutor about A2 resits specifically and (s)he said that there's no set number of resits beyond which your application won't be considered but that they don't like seeing multiple resits in the same subject and resitting multiple exams across several subjects. So two resits should be fine, if I had to guess.
You said in the OP that you didn't do that well - if so, you might want to do the retakes and then apply with achieved grades for 2017 entry. I say this because, unfortunately, your UMS average has a big role in determining whether you get an interview or not and you can't get an offer without an interview. If your UMS average is less than 85 percent at the very minimum, then it's unlikely that you'll be invited for interview as most people will likely have 90+ percent and the average successful applicant has a UMS average nearer 95 percent. Although you can still apply to other RG universities this year!