It is best to put the rack stays next to the frame, and fender stays outermost, otherwise a loaded rack has leverage on the bolts.
Does the frame have threaded bolt holes, most do, but some older ones don't.
If you have threaded eyelets, use a good quality allen bolt, long enough for rack, fender, washer, with about 2 threads exposed at the tip of the bolt.
If your holes are unthreaded, you need longer bolts and some nylock nuts. If the chain runs close to the frame, it may catch the nut, in which case, use a flat-head bolt, feed in from inside and use the nut on the outside.
Smear a little grease on threads before fitting.