Hello,
UPSC allows 6 attempts (age 32) for general candidates, 9 for OBC (till 35years) and unlimited for SC/ST till 37 years age. The attempt is only counted when a candidate enters the examination hall and attempt the preliminary paper. But if you only apply for UPSC, and do not take the paper, it is not considered as attempt.
Candidates must have a look on notice and eligibility criteria released by UPSC on their official website: http://www.upsc.gov.in/
Hope it helps.
Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile