My rule of thumb is use 3.5 gallons for a 5 gallon batch. Then you will drain and collect as much as possible, followed by sparging until you have collected just a tad over 5 gallons. This tad will be the amount you expect to leave behind when you do your first racking.
First estimate what your desired mash thickness will be. This can vary based on the recipe, your equipment and your brewing method. A typical homebrewer will use a range of 1 to 1.5 quarts of water per pound of grain. Find a ratio that will work for your equipment. The average ratio is 1.25 qts/pound. Try using more water, you will use less sparge water, extract less tannins from the husks, and end up with better a pH.
In general you will use 3 gallons of strike water for a 5 gallon batch with a 10lb grain bill. The formula is: desired mash thickness X weight of grain = Strike water volume
Example 1: Desired Mash thickness of 1.25 qts/pound with a grain bill of 10lbs would result in a strike water volume of 12.5 qts (3.12 gallons)
Example 2: Desired Mash thickness of 1.25 qts/pound with a grain bill of 12lbs would result in a strike water volume of 15 qts (3.75 gallons)
Example 3: Desired Mash thickness of 1.5 qts/pound with a grain bill of 10 lbs would result in a strike water volume of 15 qts (3.75 gallons)