You can rent either a framing nailer or a coiling nailer from Home Depot for $30 per day, if you are going to need it for more than 3 days, buy the one u/brizzodaizzo recommends from Harbor Freight. that is a good deal and you will have it for future projects, or you can sell it on craigslist for $40 and make some money back.
My personal preference is to use a coiling nailer, but that is a result of the nails I use, and that most of the fences that I build are stained instead of painted, and I just like hoe stainless steel nails perform more than galvanized.
Coiling nailer
https://www.homedepot.com/p/rental/Dewalt-Air-Coil-Sliding-Nailer-DW66C-1/309396361
Framing Nailer
https://www.homedepot.com/p/rental/Dewalt-Air-Framing-Nailer-DW325PL/316821556
When buying nails make sure they are Galvanized and they should say Ring Shank. This makes them extra hard to take out, and they are protected form the weather so they wont rust or stain as quickly as normal nails.
I actually like using Stainless Steel, ring shank nails for fencing. I think they last longer than galvanized and I prefer them if I am staining a fence vs painting. they never bleed or stain the wood. If you buy them off Amazon they are actually cheaper than the 2" galvanized nails at the big box store. You can get away with 1 1/2" nails instead of 2" especially if it is just pickets.