First step is to learn an other trick first, that is to let your horse stretch. I'll add a picture because I don't know if 'stretch' is the right word for it in english.
In the first picture she already knows it, in the second picture she is learning it. You could use a pole on the ground for it. Let your horse step over the pole with his front legs, and ask him to go forward with a treat in your hand(So he tries to take it and has to step foreward to reach it, as you can see on the picture too). In the beginning you should reward him with every little step he takes with his front legs. If he steps over the pole just let him go backwards so his hindlegs are behind the pole again. Repeat repeat repeat and your horse will know what you mean
Then you can reward with 2 steps, or three steps, and eventually only reward him when he is as far as you want him :)
You need to learn this to your horse, because if you let him bow when he isn't stretched, he doesn't have enough space to move his weight to the back and then it's harder to lower his front body. Your horse should not stand too wide, but just a little, so he's not in his 'normal' stand position.
I think you can learn tricks at every age. You should be aware that foals and yearlings/two-year-olds don't have much concentration. I personally wouldn't learn a trick to a very young horse, just let them be young. I think at an age of 2 you can do little tricks like smile and shake and stuff like that, and normal thins like go backwards, step aside for pressure. But for the bigger tricks, like stretching, bowing, rearing, etc. I should at least wait until the horse is 3 or 4. These things are physically hard work and not good for the body of a young horse.