When to use beide, and when to use sowohl? I am aware that both of these words mean the same - "both".
Can you provide few examples explaining the usage?
You are wrong. The word »sowohl« does not mean both. It means "as well" in the construction "as well as", and always comes together with »als auch« (which is the second "as" in the same construction):
Er spricht sowohl Deutsch als auch Englisch.
He speaks German as well as English.
Compare it with this construction, which is different, but expresses the same meaning:
Es spricht beides, Deutsch und Englisch.
He speaks both, German and English.
The first construction (sowohl ... als auch) is much more common in German than the second, while in English you use more often the second one. In fact in German the first appearances of the second version was bad translations from Englisch texts. This construction was not usual in German some decades ago and still is bad style.
But since both sentences mean the same, you normally change the construction when you translate:
Er spricht sowohl Deutsch als auch Englisch.
He speaks both, German and English.
But this does not mean, that sowohl in any manner can be identified with both. The two grammatical constructions in example 3 do not match, so you can't compare single words out of it.
In German you normally use both only to talk about two things that build a pair, i.e. that belong together.
Hast du meinen linken Schuh gesehen? Gestern waren noch beide in der Garderobe, aber heute ist nur mehr der rechte da.
Did you see my left shoe? Yesterday both of them was in the cloakroom, but today only the right one is here.
You need a grammar book besides your dictionary. And a good text book which shows you the differences by example:
Er kannte beide Wörter.
Er kannte sowohl das eine Wort als auch das andere.
Beide is a number word meaning all two of them. (Same as English both.) In contrary sowohl is a conjuction which is almost always paired with als auch.
The negation is as follows:
Er kannte keines der beiden Wörter.
Er kannte weder das eine Wort noch das andere.
You are absolutely right: Depending on the context, both translates to either beide or sowohl.
The former is used to refer to two things (people, objects, concepts, whatever) that are described elsewhere (i.e. at least in a separate subordinate clause). For example:
The latter is only the case in a special construction that emphasizes that both out of two items are meant, namely
The German word beide cannot be used in this sense.
With the above said, there are a few noteworthy differences between English and German: