I will try to answer to your question, but my answer will be based only by my own experience. Other users might came to Scrum Master by another ways.
Previous experience First of all, by my strong opinion, three months of software development experience is not enough. Despite the fact that Scrum Master is manager position, it required understanding of specific of software development. It is impossible to understand all the nuances of development during 3 months. As Scrum Master you will facilitate a team and remove impedances. It is impossible to do, if you not understand software development very well. You should know developers needs. Only by working as developer you could get this experience. (This is only my opinion).
Fundamental Theoretical Knowledge As I said in comment, The Scrum Guide is the Bible of Scrum. You should know and understand it well. My recommendations: read it several times on your native language and then read it several times on English. Your can find all version of The Scrum Guide on its site.
Theoretical Knowledge But The Scrum Guide is not enough to implement Scrum in real life. Scrum is adaptive methodology. It's mean, that Scrum didn't prescribe how to do everything. There are a lot of sites and books where you can find this "missed" knowledge. Here you can find a lists of books for all Scrum roles:
Suggested Reading for Scrum Master Role
Suggested Reading for Product Owner Role
Suggested Reading for Developer Role
Also, you can find a lot of interesting articles on Scrum.org and Scrum Alliance portals.
But remember, all things (that you will read on these books) may or may not work in your case. It depends on you, your team, your company, business conditions and many other things. Only in Scrum Guide you can find "absolute truth" :-) All other books just give you advices, that may not work in your case. [Phrase about "absolute truth" sounds like sermon in the sect :-)]
Practice And of course, practice is the best teacher. Scrum theory is very easy, but to implement it in real life is very difficult challenge. Scrum is empirical process, so practice is everything in Scrum. Do not be afraid to experiment. Trial and error method is Scrum way of solving problems
Community You will not find all answers (on questions that you will meet in your practice) in books. So, you should took active part in community life (like PMSE, Scrum.org Community, Scrum Alliance Community, Real life meetings and so on). Don't be affraid to ask questions. There are no stupid questions at all.
Training By my opinion, it will be better if you will go to training, when you already will have enough practice in Scrum. In that case, you can not only receive basic knowledge about Scrum, but also ask your coach about real questions from your practice.
There are two most famous Scrum training providers: Scrum.org and Scrum Allience. I passed Scrum.org training. But it's a matter of taste.
Certification When you will have enough knowledge and experience, you can try to pass one of Scrum certification.
The same as with training, there are two main certification provider: Scrum.org and Scrum Allience. I passed PSM I from Scrum.org, but you can choose another one. Take a look to the question with comparison of these two certification: Which Scrum certification provider is most widely recognized or accepted?
During passing PSM I, most big problem for me was "language barrier". As you can see, my english is rather poor. So, it was hard to translate questions fast. I passed PSM I only from second attempt, because during my first attempt time ended faster, than I answered all the questions. But the questions themselves were not very difficult.
P.S. Point of view to this question: