1) I don't know of any municipality in my area that requires a maximum of 1 layer of shingles on the home at any given time. 2) I have 'heard' that there are municipalities in the country that allow up to 3 layers (but I can't confirm it.) 3) In my municipality and those around me, there is a 2 layer maximum.
Your question is regarding the 'condition' of the shingles. Let's use my municipality as an example; it has a 2-layer max ... The first layer can be brand new or old as dirt over which you are allowed to put new shingles. The question is: If the shingles are in such bad shape, would it be prudent to remove them first, or just simply go over them. For me, I'd remove them because if they're in such bad shape, there's a good chance that there may be other problems, or soon-to-be ones, under the bad shingles. Kinda like peace of mind. BUT, again, you can go right over them if you wish.
If the shingles are breaking at the corners, splitting/cracking, falling out-of-line, etc., etc., if you were me, I'd remove them right down to the sheathing. The only other item to consider is cost. Certainly it's cheaper to not remove them but you have to weigh the risk in not doing so. Your call. My best to ya and hope this helps.