I have a question about my sub panel that I'm installing in a shed in the back yard. I'm using a 3 wire feed from the main panel to the sub panel (H-H-N). ...because I'm using the 3 wire feed, I'm going to be putting in two ground rods no less than six feet apart with a continuous 6 gauge wire connecting the rods to the ground bar in the sub panel. I know that you're not normally supposed to bond the neutral bar in a sub panel, but is that because you normally have a ground wire in your feeder? Should I bond the neutral bar in this case because I don't have a ground wire feeder? Or should I still keep it un-bonded?
If you're in an area that has adopted National Electrical Code, you'll have to run a 4 wire feeder. You'll also still need the ground rods at the shed, which you'll bond the grounding bar in the panel to.
If it's an existing 3 wire feeder, and there are no other conductive paths between the buildings. Then yes, you'd bond the grounded (neutral) bar. However, if there are other conductive paths between the buildings (water pipe, conduit, gas pipe, etc.), then you'll need a 4 wire feeder.
If this is a new installation, you'll need a 4 wire feeder.
Ground rods are not a substitute for a ground wire. They do completely different things. Ground rods cannot do a ground wire's job because dirt is a terrible conductor. It cannot return enough fault current to trip the breaker, for instance.
Ground rods are to return natural currents like ESD and lightning.
Bonding neutral to ground in a subpanel would be even worse than hooking it up to only the ground rod, which is still bad.
If you are stuck with the 3-wire feed, go 120V-only... or 240V-only... or 240V for most loads and a 120V transformer for a few 120V loads... or a large transformer and make this a separately derived service.
If you only have a HHN 3-wire feed from source (house), then your shed sub-panel becomes a main panel and Neutral-Ground bonding at shed's panel IS NEEDED for hazard avoidance. Below 4-wire shed refers to your house feeding the shed with HHGN wires. Here's why:
Ground Wire (GW) GW should not carry current in normal operation but must momentarily carry the full current during a short circuit, e.g. when the hot wire of your shed toaster touches toaster's metal chassis, which should have a GW connected on toaster's plug. So, how to GW magically carry the short circuit current to trip the shed panel breaker? Answer, it was BONDED AT SHED PANEL, so GW is same as Neutral but GW is only used during a short circuit. If you do not bond Neutral with GW at shed panel, then there is not return path for the short circuit and breaker will not trip, electrocuting whoever touch the toaster chassis. NOW, it were a 4-wire from source (house), then you would simply use the house's ground wire, which is bonded at house panel (so shed panel should not be bonded if you have 4-wire incoming)
Ground Rod (GR) GR is to take care of lightning and to make your GW at the same potential as mother earth. If your shed has only 3-wire incoming and you do not bond GW with neutral, the GR will not do anything for you, except electrocute whoever touch the toaster.
The earlier posters is correct that dirt is a bad conductor. Even if it was a good conductor and you did not bond N-Ground for a 3-wire shed, the person touching the toaster will still be toasted. So, the other poster saying only bond at house main panel, not shed panel is WRONG for a 3-wire shed but he is correct for a 4-wire shed.
Your house is feed from the power grid with Hot-Hot wires with a center Neutral tap (so HN = 120VAC). So, your house has 3 incoming wires. At the shed, think of the 3-wire from the house = 3-wire from the grid, so shed panel is main panel equivalent. If 4-wire, then shed is not an independent house and should not be bonded because house already bonded.
Summary: 3-wire shed - BOND NEUTRAL WITH GROUND of Shed Panel. 4-wire shed - DO NOT BOND Neutral with Ground of Shed Panel
If you shed is "10-miles" away, even a 4-wire feed from the house would make house's GW ineffective given the distance/resistance. So in a very distant shed with 4-wire, do not connect/bother to use house's GW, just consider you are getting a 3-wire and do what recommended earlier for a 3-wire shed.
Note: If your house was built before 1999, you are most likely to have only 3-wire circuits. "The National Electrical Code (NEC) began requiring a 4-wire system instead of a 3-wire system (hot-hot-neutral) for certain installations, particularly for new construction or major renovations, as part of the 1999 edition. "