3-wire feeders to detached structures that had no other parallel metallic pathways(eg. conduit, water and gas piping, communication cabling, etc.) were allowed up until the 2008 NEC code cycle.
From then on, 4-wire feeders have been required.
4-wire feeders to panels in attached structures have always been required.
3-wire feeder to detached(no longer allowed as of 2008):
4-wire feeder to detached:
4-wire feeder to attached structure: