The period from July 4 to July 8, inclusive, contains 8 - 4 + 1 = 5 days, so we can rephrase the question as "What is the probability of having exactly 3 rainy days out of 5?"
Since there are 2 possible outcomes for each day (R = rain or S = shine) and 5 days total, there are 2 x 2 x 2 x 2 x 2 = 32 possible scenarios for the 5 day period (RRRSS, RSRSS, SSRRR, etc...) To find the probability of having exactly three rainy days out of five, we must find the total number of scenarios containing exactly 3 R's and 2 S's, that is the number of possible RRRSS anagrams:
= 5! / 2!3! = (5 x 4)/2 x 1 = 10
The probability then of having exactly 3 rainy days out of five is 10/32 or 5/16.