It'll take some practice on your equipment to nail it every time. Until then it doesn't have to be perfect to come out good.
If you boil off more than you thought you can always top off with water.
If you think you haven't boiled off enough, before your late hop additions you can decide to boil longer -- this will increase bitterness a little but not much, and increase the maltiness a little.
If you have graduation marks in your pot that helps, or you can make a dipstick. I used a wood dowel. I poured a measured gallon of water into my pot and made a mark on my stick, then another gallon, then another mark, etc. You could do it in half gallon or quart increments or whatever. Just remember that boiling wort takes up a little more volume than room temperature. According to beersmith, it would be .09 gallon for 3 gallons and .08 for 2.5 gallons, so just a little difference. I measure sometimes during the boil -- I just stop the flame for a few seconds so the bubbling stops.