Proto-Indo-European seems to have had a dual number (for two things), so many Indo-European languages show remnants of it: it's attested in Ancient Greek, though not quite as abundantly as in Sanskrit, and left various traces across Latin. It's still used today in some Celtic languages. Over in the Semitic world, Biblical Hebrew and Quranic Arabic also had a dual, though like in Indo-European it's atrophied a bit over time; it still shows up in day-to-day Arabic, but in Modern Hebrew it's restricted to a limited set of nouns.
Some languages go one step further and mark a trial number (pronounced "TREE-al" rather than "TRY-al"), used for exactly three objects; this shows up mostly in Austronesian languages, most famously in Tok Pisin (but only for pronouns) (*). Others have a paucal, used for small groups of things, where the definition of "small" depends on the language; this shows up to some extent in modern Russian and some other Slavic languages, for example.
As for advantages…I don't think anyone's shown objective benefits or detriments to having a dual number. It makes it easier to specify "two people" without using an extra word, like how English can easily distinguish "another person" from "other people", but other languages (Mandarin, Japanese) get by perfectly fine without any grammatical number marking at all. Different languages do it differently, and the details just come down to their particular history, not to any universal benefits or drawbacks.
(*) Tok Pisin is a creole combining English, various Austronesian languages, and a smattering of others; its trial number definitely comes from Austronesian, but it's not quite an Austronesian language in its own right.