How many pills does the average person take in their lifetime?

Depends. I doubt that any one has actually compiled this number. First what are pills: medication only, supplements. Over the counter medication? And of course this will be influenced by the sex, and the geographic location and the presence of underlying disease.. There probably is no studied answer but in first world countries it must be in the 10's of thousands.