First, note that we have a finite number of trials, $n = 4 ($although the game goes on forever, we are only concerned with the first $4$ balls.$)$ Each trial is a Bernoulli trial - that is, each trial has only one of two outcomes: white and not white. Define a success as the event that a white ball is drawn. Then the probability of success $p$ is $p =\dfrac{1}{2}$. Since each ball is replaced after it is drawn, we have sampling with replacement, and thus independence.
Since we are dealing with a finite number of independent Bernoulli trials with a constant probability of success $p$, we use the binomial distribution
Let $X$ be the number of white balls (successes) that appear in $n = 4$ trials. Then we want to find $P(X=2)$
$$P(X=k)=\dbinom{n}{k}p^k(1-p)^{n-k}$$
Then,
$$P(X=2)=\dbinom42\left(\dfrac{1}{2}\right)^2\left(1-\dfrac{1}{2}\right)^{4-2}$$
$$=\dbinom42\left(\dfrac{1}{2}\right)^2\left(\dfrac{1}{2}\right)^2$$
$$=\dfrac38=0.375$$