A base on balls is defined in the Definition of Terms (Base on Balls).
(a) The official scorer shall score a base on balls whenever a batter is awarded first base because of four balls having been pitched outside the strike zone, but when the fourth such ball touches the batter it shall be scored as a “hit batter.”
Rule 9.14(a) Comment: See Rule 9.16(h) (Rule 10.16(h)) for the procedure when more than one pitcher is involved in giving a base on balls. See also Rule 9.15 (Rule 10.15), which addresses situations in which a substitute batter receives a base on balls.
(b) The official scorer shall score an intentional base on balls when the pitcher makes no attempt to throw the last pitch to the batter into the strike zone, but purposely throws the ball wide to the catcher outside the catcher’s box.
(c) If a batter awarded a base on balls is called out for refusing to advance to first base, the official scorer shall not credit the base on balls and shall charge a time at bat.