There are lines drawn on the field that connect the bases. The lines from home plate to first base and from home plate to third base are used to determine if a ball is in play. If the ball is hit between the baselines, it's in play. If a ball is hit outside the baselines, it's called a foul.
In 1887, a rule was adopted for that year that counted only walks as successes, which wreaked havoc on statistics. An initially ejected runner may be declared safe if the outfielder who pulls the runner out drops the ball (either in a tag or force play), removes his foot from the base (in the case of a game of force), or illegally prevents the runner from reaching a base where he would otherwise have safely reached. If they balance and fail, or don't do so on a field that the referee judges fair, it's called a strike. This rule of permanent substitution contrasts with other sports, such as basketball, hockey and American football, that practice free substitution.
In addition to that rule, in theory, a game could end if both the home and visiting teams ran out of players to replace (see substitutions below). If a ball declared a foul point is caught, with two hits on the count, it is considered a third strike and out; if it is not initially caught by the receiver, it is still a two-hit free ball. When they meet for office, the president or, in his absence, the vice-president, shall appoint an arbitrator, who shall keep the game in a book provided for that purpose and shall record all violations of the statutes and rules during the exercise. Running the bases is one of the most fun parts of youth baseball, but yes, there are a lot of rules for it.
Many fan leagues allow a starting player who has been eliminated to return to the game in the same position in the batting order under a re-entry rule. Pitchers replace each other just like any other player (see above), and the rules don't limit the number of pitchers that can be used in a game; the only limiting factor is the size of the team, of course. This was probably the most controversial rule change in baseball history and is still the subject of lively debate. Lineup changes are strictly limited by baseball rules and should be communicated to the referees, who announce substitutions for the opposing team and fans.
The most recent significant rule changes, which prohibit the use of steroids and other performance-enhancing substances, have been widely supported to protect the integrity of the game. When he meets for office, the president or, in his absence, the vice-president, shall appoint an arbitrator, who shall keep the game in a book provided for that purpose and shall record all violations of the statutes and rules during the exercise.