Remove the window and door trim and baseboards, unless you are planning on painting them as well. Also remove switch and plug plates, window treatments and anything else you don't plan to paint. Pull out nails and screws.
Scrub the paneling with trisodium phosphate (TSP) or another grease-cutting detergent. Most paneling has been waxed or oiled at least once; it needs to be squeaky clean before priming. To combine the washing and sanding steps, use wet-dry sandpaper or a sanding sponge to scrub the paneling. Rinse it and let it dry.
Prime the paneling with fast-dry oil-based primer or tinted shellac primer. If the paneling has grooves, use a lambswool roller cover instead of a synthetic one. They are a little more expensive, but hold more paint and will for the most part fill in the paneling grooves so you don't have to do each one with a brush.
Caulk all the gaps in the paneling, between the paneling and the ceiling, and around the trim. Caulking works fine for small nail holes as well; simply dab it on with your finger. Wipe caulking smooth right after you apply it.
Use spackle or wood filler for larger holes, and sand them when dry. Put a spot of primer on each repair, otherwise they will show up in the finish paint as flat spots. Caulking doesn't need to be primed.
Paint the paneling with two coats of good quality water-based paint. Cut in with the brush before rolling to avoid a visible line between brush and roller marks.
Allow the painted paneling to dry for at least four hours before putting the room back together.