The first general rule for cooking pasta is, PLENTY OF BOILING SALTED WATER!
One gallon for every pound of pasta and at least 2 teaspoons salt.
The salt flavors the pasta from the inside out. If necessary, stir when you first put pasta in to keep it from sticking together.
A stockpot or Dutch oven is what you need. Cooking pasta in too small of a pan and too little water makes it gummy. When it comes back to a boil, time it for 10-15 minutes, until pasta is “al dente” – “to the tooth” – tender, yet still with a bit of chew.
Don't add oil unless you plan to use it in a cold pasta salad. Oil keeps the sauce from clinging to the pasta. Don't rinse pasta, as this removes some of the carbohydrates.
Drain but leave a bit of water in the pan to keep the pasta from sticking together.