I'm confused 'domo' literally means 'very' so I can't understand why they use it as a way of greeting
The modern day use of どうも as a greetings stems from the Edo period phrase どうも言えぬ, lit. "unable to speak in spite of oneself", used positively much like the way we use the English word "awesome" today. The どうも here was taken from the phrase and was used like すごく or 大変 (which would be translated as "very" or "quite).
どうも alone as a greeting is actually a shortening of the above sentences. One of the strong points of this is that this one "greeting" can have many implications and is so flexible. Of course, some people find it rude and would prefer that the full sentence is used.
I'll give you tl;dr for this question.
During edo period, "domo" was used to express the feeling of confusion or unsureness about the person who he/she is talking to.
"Domo nani mo ienu" is an old way saying "I am very unsure about what to say to you" or "I am very unsure who you are".
In 1950s, the usage of domo was considered insincere.
In 1960s, Keizo Takahashi spread the usage of domo on TV.
In 1970s and 1980s, Sanma Akashiya and Mari Yoshimura changed the word from expressing unsureness to greet someone in a friendlier way.
Referencing the top answer here:
It seems that its use as a greeting is not exactly "standard Japanese," but rather a relatively new usage popularized by a free-lance announcer by the name of Keizou Takahashi after the second world war.
However, you seem to misunderstand the meaning of 「どうも」 overall.
Loosely translating the dictionary entry linked in the comment, we have:
- No matter what you try, 〜 (something is not satisfied)
No matter how many times I try, it won't go the way I want it to.
- Not sure why, but 〜
I'm not sure why, but something is wrong.
- A way of intensifing one's gratitude or apology.
どうもありがとうございます。 Thank you very much.
- As a of casually greeting or thanking someone.
"very" is not included among the listed meanings. For that, you might be better off using 「とても.」
Take my translations with a grain of salt. I am not a native speaker, but I hope the sentences and their translations can at least help you grasp the nuance of どうも a little better.