People can't just automatically gain these by ranking up. We have to have a simple and easy system.
To train elements: You start with your dominant element. When you reach chunin you can start your second element training. When you reach jonin you can start your third element training.
First recessive takes a thread of 800 words.
Second recessive takes a thread of 1000 words.
To train an element you must first do the paper test to see which element is yours. The second step is to start training it. It's easier to have someone with that element from your village to teach you but if someone in the village doesn't have that element you may use a scroll to teach you. You're free to train how you think someone would train that element BUT you may not waste your thread with useless gibberish or stuff that has nothing to to with training. You MAY be able to train in another village with both kage's permission. The villages must be friendly though.
To train a specialty:
You may start training your second specialty when you are a special jonin.
It takes a 800 word thread to train it. You may train it however you see fit as long as it's not useless drivel put into your post. Also you should try to learn from someone who has that specialty in your village.