The neutral wire from the circuit is shared by both sets. To wire a gfci circuit breaker see this link and wire a gfci switch combo at this link.

Gfci Receptacles Massachusetts Home Inspections
Wiring two gfci outlets together. How many outlets can connect to the first gfci outlet. Do not put any wires together the power is still on. A gfci circuit may be protected by either a gfci circuit breaker or a gfci outlet but not both. Gfci outlets and circuit breakers. Electricians hardly ever wire outlets this way but its good to know about it because it gives you near 100 percent assurance of circuit continuity. Its a good way to wire a gfci outlet if you want outlets after it in the chain to stay on when the gfci trips but be aware that those outlets wont have ground fault protection.
Turn all electrical power off again. You can add any reasonable number of outlets the concern is to stay within the amperage load of the circuit distance is not a problem as long as your under 200 feet depending on the. These two outlets are on a circuit together and they are the only loads on that circuit. Using the feed through method is there a limit on either the number of downstream receptacles or the distance beyond the gfci outlet. After wiring the new outlets up and testing them i noticed an odd behavior. I have two countertop outlets in my kitchen that i am in the process of replacing with new gfci protected outlets.
Make sure the amp rating of your new gfci outlet matches the amp rating of the wiring and breaker or fuse. Here 3 wire cable is run from a double pole circuit breaker providing an independent 120 volts to two sets of multiple outlets. When you need to wire multiple gfci outlets such as in a kitchen or bathroom you have a couple of options. Wiring for a switch and gfci receptacle in the same box is also shown. This diagram illustrates wiring a gfci receptacle and light switch in the same outlet box a common arrangement in a bathroom with limited space. This wiring is commonly used in a 20 amp kitchen circuit where two appliance feeds are needed such as for a refrigerator and a microwave in the same location.
Typical wiring methods for two gfci outlets. Wiring a gfci outlet and a light switch. To save money you can put in a single gfci and then wire additional standard outlets to the load output from the single gfci. Wiring multiple gfci outlets. Having two sources of gfi protection can create nuisance trips of the devices therefore i would select one or the other. Line and load will be clearly labeled on the back of the gfci outlet and often times the load side will be covered with a piece of tape.
Unscrew the terminal screws of the new gfci outlet until they are difficult to turn. This provides the same protection as having a gfci at each location. Connect the black line hot wire to the brass screw marked line by inserting the wire into the back wire hole. Wiring diagram for dual outlets. Refer to the diagram above about wiring gfci receptacles for additional help.