Multi domain certificate

I’ve got a web application that serves 2 domain names - ‘domain.com’ and ‘domain.ru’. Also usage of ‘www’ is allowed.

If I choose a multi domain certificate product will my domains be regarded as 4 different domain names or only 2?

Four.

You could simply force a redirect from without the ‘www’ to the ‘www’ or vice versa and then you would only need two entries.