http://compuserve.nba.com/media/rule_book_2005-06.pdf
See page 6 for the NBA interpretation.
For highschool and NCAA, if the player gets his/her 5th foul, then automatic disqualification. If in the judgment of the officials the team has a chance to win, then you could go all the way down to 1 player.