recently I've been trying to write some 1 and 2 finger tapping riffs but I'm confused as to which frets i should use. Is there like a certain idea or template used for writing tapping riffs or is it completely random?
Play what sounds good to your ears. There is no such thing as a "template" for music, although if you wanted to start somewhere you could pick a certain scale. Good luck!
Ibanez SZ520QM - Transparent Red
-Seymour Duncan '59 in the bridge/Coil-Tapped Pearly Gates in the neck
Synsonics Strat Copy with Hotrails Pickup in the bridge
Vox AC15cc Tube Amp
Vox V847 Wah
Digitech JamMan Looper
Cusack Screamer OD Pedal
arpeggiate chords.
if on your B string you play

12p9p5 12p9p5 You are arpeggiating a E chord.

Take a key and take the chords that fit in them and do this to them.
Heres a tapping thing I wrote that is just arpeggiating chords

repeat each 4 times:

         Am          G         Am      Dm           A m      G        F#m     D 

This does not fall in any key, but you would have to make it if you were in a band situation with backing intruments.
So put some chords together than arpeggiate them tapping, it sounds good to me.
Gibson SG Standard
Ibanez S2170FB
Peavey JSX
Marshall 1960A