Hi I am coming to Cologne (Germany) in August for three month... which are the nearest countries I can visit easily by train
Well, the countries that border on Germany are the most obvious - and given that there are so many of them, then you'll be spoiled for choice!
Often the ease of getting to a country/place is not just dictated by distance, but also by geography (if there are mountains in the way, it can make for a much longer journey, for example). Thus, you should be guided by the excellent www.bahn.de website, which you can use to research various options - it has a very user-friendly English option if you look for the GB flag on the top of the screen.
Perhaps also bear in mind that although rail travel in German is cheap by international standards, the costs can rise significantly once you cross a border. If you are planning to do international trips, then you will get better deals if you book as far in advance as possible.
Personally, I would suggest that you perhaps focus on the destinations close to, or easy to access, from Cologne - maybe Brussels combined with Bruges,
If you still have time and money to spare, then I would motivate that Salzburg (the setting for the iconic Sound of Music movie) is well worth a visit - all the more so, because although it's in Austria, it is still considered to be part of the Bavarian rail network, and thus, affordable to access from Munich. Prague is also easily accessible by rail, and the train journey through the gorgeous River Elbe valley is stunning.
The last piece of advice I'd offer is to hold off on travelling to the more heavily touristed destinations such as Paris, Amsterdam and Prague until the beginning of September. Once the summer holidays are over and school year begins, tourist numbers drop off markedly and prices drop as a result, making it much more pleasant to travel. Given the choice, I usually opt to travel in September/October, when the weather is often more settled than in summer, and the onset of autumn can be absolutely stunning.
Above all, enjoy the planning, which is an integral part of the travel experience.
Mentioned in this answer: