The key equation you need is D = R * T, where D is the distance traveled, R is the rate of travel (i.e. the speed), and T is the amount of time traveled at that speed. You will need to use this formula twice, once upstream, and once downstream. You will end up with an equation for each in two variables, which turns out in this problem to be R and T. The fact you have two equations in R and T, will allow you to solve them for each variable; although the variable we're only interested in in this problem is R.
Upstream Analysis: We know D = 8 miles, and the rate of travel is R - 2, where R is the speed of the boat in still water. It is R - 2, because we are going upstream, and the current is slowing us down by 2 miles per hour. For time, T, we don't know how much time it takes to only go upstream (we only now how long the round trip takes), so call it T, for now. So our equation that results from our upstream analysis is 8 = (R-2)*T. [Equation #1]
Downstream Analysis: We know D = 8 miles again, and this time the current is working with us to move us faster, so the speed is R+2. Once again, we do not know the time, but now we can use the fact the round trip took 3 hours, and the trip upstream took T. So time to go downstream is 3 - T. So our equation that results from our downstream analysis is: 8 = (R+2)*(3 - T). [Equation #2]
So now you have two equations in two unknowns, and are able to solve for R, the rate in still water.
Also, be careful in these problems that all your units are the same. In this problem, miles and hours are the only units of distance and time used, so it is not an issue. Some problems, however, will give you mixed units such as speeds in miles per hour, and then tell you that the trip took 20 minutes. In that case, you will have to pick one (e.g. hours) to which you will convert the others (e.g. minutes).
If you need more help, please clarify where you are in the process and what's giving you trouble. I'd be more than happy to continue to assist.