Chesty was about 9 or 10 months old when he started lifting his leg, and he's 17 months now and sometimes he does other times I think he's just being lazy and squats.
Its not instinct it is a learned trait. I have 2 boys and on flat ground they squat but it they are near a bush or tree they try to raise their legs...
My EB doesn't lift his leg yet and I don't think he will. He's a bit lazy. Our other male dog lifts his leg. He was never around other male dogs to learn how to do this (he was only around females) but my female dog who is younger than him lifts her leg. So i think it is a mixture of learned and innate behavior