Never train a young puppy with your electric dog fence before he is at least two months old. Around this time, you will probably be starting to train him in other ‘elementary' things, like how to sit, come, or even fetch. At this age, they also have the grasps of what we call ‘operant conditioning', which is the idea of changing his behavior based on reinforcement from the environment.
Being able to use commands like ‘Stay' or even ‘Stop' are also very helpful as part of the whole training process.