How do I intall GFCI breaker if wire for outlets is 12/3 using two breakers?
I wanted to have the outlet GFCI protected but did not know how I could use GFCI outlets and have the top of bottom of the outlets be powered but two different breakers.

You can’t make a GFCI receptacle work that way.  It can only protect one 120V half-circuit; you have two.
To do this with GFCI receps, you would need seven of them, and each one would be on a different circuit (i.e. both sockets on the same subcircuit).

That is when I found out that I had one 12/3 wire with black, red, white, and ground wires. I tried to use two different GFCI breakers by trying to wire nut two wires off of the white wire so that I had a white for each GFCI breaker. When I turned on one of the breakers it was fine, but when I turned on the second breaker it tripped both breakers.

Yup, that can never possibly work.  That is not how GFCIs function.   They are comparing the current on the hot to the current on the neutral.  If they are different, current is leaking somewhere.  So from each individual GFCI’s perspective, current via the other GFCI is a ground fault, and they must trip.

I thought that I might have to buy a double pole 20 amp GFCI breaker in my situation to make this work. I am not positive how double pole breakers work.

Yeah, and I bet you’re getting real sick of spending $100 over and over on things that don’t work.  Good reason to ask!
However the 2-pole GFCI is the right solution for this.
A 2-pole GFCI monitors all three wires, assuring the currents are equal (or to be more precise, net out to zero... counting outbound current as equal and opposite to returning current, on whichever wires it may occur).  Now, neutral is not bypassing the GFCI so all neutral current is being correctly counted.
By the way, if working with and replacing outlets, never splice the neutral wire on the outlet.  Neutral must always be pigtailed.