Unfortunately, there is no simple rule for compound words. They really have to be learnt individually. However, you can categorise them into different groups, which might help you to remember them.
One word made from two words
We are going to open a new factory. Moreover, we will be creating 1,000 new jobs.
Due to your actions your employment has been terminated. Furthermore, you will be reported to the police.
I made the mistake, therefore I should take responsibility.
I like the red carpet, whereas my wife prefers the blue. I don’t think we are going to agree.
The police blocked all the exits. Meanwhile, the robbers left through the tunnel they had secretly dug. Ever can used with most question words to make compound words:
You can choose whatever you like from the menu.
Wherever we go this weekend it’s going to rain.
However hard I try I just can’t finish this level, it’s too hard. I hate this game.
“When do you want to leave?” “Whenever you’re ready is fine with me.”
Whoever gets there first will be the winner.
One word made from three words
We may have lost this battle, but nevertheless we will continue and win the war.
We built the house under budget, albeit two months behind schedule.
We are going to sell the company, your objections notwithstanding.
This is a heretofore undiscovered species.
I don’t think he has the wherewithal to run his own company.
Losing my job was the best thing that happened to me, inasmuch as it challenged me to do new, more interesting things.
I’ll support you, insofar as it doesn’t interfere with my own plans.
Three individual words used together with a single meaning
as long as / so long as
I’m going to take the car to the shops, as long as you don’t need it for work.
so be it
“I’m sorry but we have to split up.” “So be it. It’s been coming for while and I think it’s for the best too.”
as well as
Mum’s coming to the party as well as Aunt Jo.
as soon as
Let me know as soon as he gets here.
in order that
I lent her the car in order that she wouldn’t have to take public transport.
Not just grammar words
With the exception of the noun wherewithal, the compound words above are mainly grammar words. They act as adverbs or conjunctions and are quite formal in many cases. However, as well as grammar words, there are also many compound nouns in common use. For example: handbag, suitcase, airport, underground, toothpaste, babysitter. For more extensive lists, try a quick internet search for compound words.