AIDS isn’t an illness in and of itself, the S is for “syndrome,” in this case an inability to fend off one or more of a series of component diseases. In the case of AIDS at least one variety of pneumonia is one.
Essentially anyone in the US who tests positive for HIV (and even especially in the early years some people who had a “presumptive diagnosis” thereof) and dies of a CDC-recognized component disease gets added statistically as an ‘AIDS death,’ although the more proximal cause of death will always be something more specific.