I'm attempting to build a rocket with 8 fins (four on bottom and four smaller ones towards the top). The four fins near to the top will be attached to servo motors and programmed to stabilize or guide the rocket. The problem I ran into is that if the rocket spins, then the fins will be useless, the rocket would just spiral. So is there something I can do or add to the rocket so that it won't spin? Any help will be greatly appreciated, I'm relatively new at this.
Foreword: This is generally considered a difficult proposition, and books have been written on the subject. This "technology" could also fall under ITAR, so that's why there was some hesitation in answering your question at first. The consensus in the model rocket community seems to be as long as the goal is straight up, and not towards a target, it's fine, but IANAL. There is also a lot of additional information in this thread on the Rocketry Forum.
Basic Rocket Science
Every flying thing has two very important points that determine how well it will fly, known as the Center of Pressure (CP) and the Center of Mass (CM). The CM you are probably most familiar with; it is also known as the centroid, and is essentially the "average" location of the mass of the vehicle. In other words, if you were to cut the vehicle in half along any line that passed through the CM, both halves would weight the same. The CP is similar, but rather than worrying about the mass, you are averaging the drag/lift on the whole vehicle.
Odd as it may seem, you can largely predict how any airplane or rocket will perform just by knowing where these points are. If you want pictures, there's a great explanation here: https://i.imgur.com/qoJjVPu.jpg
Putting that diagram in words, if your CP is "behind" your CM with regards to the direction you want to go, then it will be stable, generally wanting to stay going in a straight line, like a dart or an arrow. If your CP is ahead of your CM, it will want to flip around and fly butt-first. This is bad. If they are aligned, your rocket will just flip all over the place, like a sheet of paper. You can also experiment with this by making a paper airplane, and placing a paperclip at different places along the centerline. Where it is placed will affect the behavior of the plane.
If you want the most maneuverable vehicle, like a stunt plane or a missile, you want your CP and CM to be close together, so that the control surfaces (the things you can adjust, like ailerons, rudder, etc.) don't have to move that much to have a large effect. You might think that therefore you should have fins at the front and the back, to balance the CP, but it's not that simple:
The rocket nose itself generates a lot of drag, generally causing the CP to be roughly centered with just rear fins.
The CM on a rocket moves during flight. The rocket motor is generally the heaviest part of the rocket, and is generally located at the back of the rocket. For this reason, the CM generally moves forward during flight. If your CP & CM are close at the start of the flight, they will be far apart once the motor has burned, which means the flight behavior you start out with is not what you have a few seconds later. Rockets which have this problem generally wobble a lot right off the launchpad, then suddenly straighten out and go flying in a weird direction. The wobbling will make control more difficult.
For mainly the second reason, you generally want to have ~2 "calibers" of stability for your rocket. This means that your CP is roughly 2 body-tube diameters behind your CM when you launch.
Now, you might say "But if I can build a "stable" rocket without controlled fins, then what good is active stabilization?" There are a couple things that control could solve, one of which you have already mentioned:
Spin: If the fins are not perfect, or if the rocket nozzle is offset, or for many other reasons, non-stabilized rockets can spin. A "guided" rocket (I would use "stabilized") could overcome this problem, leading to a prettier launch, better on-board video, etc. A worthy goal.
Weathercocking: If you are launching with a slight wind, or if there is wind at altitude, then as the rocket travels through it, it will want to fly into the wind. A stabilized rocket could adjust to keep going perfectly straight, which would be awesome. However, you should note that the rocket comes back down through the wind, this time on a parachute that travels downwind. Often flying slightly into the wind is good, as it can lead to the rocket touching down close to the launch site, rather than drifting a mile downwind. Your stabilized rocket could account for this, though, and calculate an optimum angle to get it to land back on the pad.
Design of Control Surfaces
Although I said that fins up high might not be the best idea, some rockets do have the controlled fins higher up, this is because they are incorporated into the avbay. Harder to design aerodynamically, easier to build mechanically.
Servo motors should work as actuators, at worst if they are underpowered you will still have a stable rocket. I don't know what you are planning to use for a microcontroller, but a fast arduino should work, you may have to optimize your code though. You will also need something to sense your position - not GPS, that is too slow, you probably want an IMU breakout board (a bunch of accelerometers that tells you your position). This gets you your computer, your position, and control of your control surfaces.
For the actual control algorithm the PID (Proportional-Integral-Derivative) family is probably your best bet. Starting out with just P control is what I would recommend, then add I once P is working okay. P control means that there is a link between how far the rocket is off course, and how far the control algorithm wants to tilt the fins. This relationship is linked by a constant ratio, so it is Proportional. Integral control will allow the rocket to slowly "learn" about imperfections, like the servos not turning as far as they should, etc. Creating a virtual model of your rocket and controller in python or some other programming language is also recommended, it will help you understand more and testing things out virtually first will be less expensive than launching 100 rockets. There is some additional advice on the Rocketry Forum with regards to tuning here.
Lastly, a word about legality. In the USA, a stabilized rocket doesn't appear to be illegal (IANAL), but flying rockets above a certain power outside of a NAR or Tripoli launch definitely is. If you are outside the USA, Tripoli has some international clubs, and I imagine there are other organizations. Joining a local club will give you a multitude of advantages, including:
Mentors that can help you design and build your rocket in such a way that it doesn't immediately crash.
Some degree of insurance in case you damage a house, car, etc. with your rocket (at an approved launch).
Knowledge of where good launch sites are, and permission to launch there.
Access to higher-power rocket motors, to help you launch a rocket to higher altitudes or with a bigger payload.
An established friendly relationship (hopefully) with local law enforcement.
Regular meets, where you can see lots of different kinds of rockets, and learn what works and what doesn't.
If your local university has a rocket club, you may also be able to find help in designing the controller for your rocket.
PS: If you want to design a rocket, I have found OpenRocket to be a good software to design in, there are a few tutorials out on the internet as well. If you want to design virtual rockets and actually fly them, KSP (while requiring some cash and a decent computer to run) is great. There are also some mods (kOS is one example) that allow you to mess with PID tuning in the game, effectively making your own flight controller.
UK guided missiles historically tended to use a "twist and pitch" scheme, which only requires two steerable fins. The vehicle rolls to the correct angle and varies in pitch.
It might be worth looking into that as it may require less weight for the actuators, and it may be conceptually easier to understand.