The main clause is:
Vor drei Monaten musste er sich von jemandem trennen.
Three month ago he had to break up with someone.
It consists of this parts:
- vor drei Monaten (on position 1)
three month ago
{period of time} "ago" = "vor" {Zeitspanne}
"three month" = "drei Monate", in dative case: "drei Monaten"
- musste (on position 2)
a form of "müssen" = "to must" or "to have to"
- er
he
- sich von jemandem trennen (trennen on last position)
to break up with someone
But the original sentence also contains this subordinate clause:
, der ihm sehr viel bedeutet hat.
, who meant a lot to him.
This subordinate clause is a closer description of jemand/someone, and since it is not a main clause, but a clause that is subordinated to another clause, it has a different word order.
Position of verb in main clauses:
In German, in a main clause which is a statement (i.e. neither a question nor a command), the finite verb always must occupy position #2 of the sentence. On position 1 you find »vor drei Monaten«, position 2 is »musste«. But the complete verb is »trennen müssen« (have to break).
When ever a verb has more than one parts, only the finite part (this is the part, that needs to be declined according to the subject) goes to position 2. All other parts (here: »trennen«), i.e. the infinite verbs, i.e. all parts that are not declined together with the subject, go to the end of the sentence.
Position of verb in subordinate clauses:
The rule, that the infinite parts go to the end of the sentence, is also valid for subordinate clauses. This means, that also in subordinate clauses the infinite verbs occupy the place at the end of the sentence.
But the position of the finite verb is different: In subordinate clauses it can not stand at position 2. It also goes to the end, and the finite verb even has a stronger urge to move to the end, so that within all words that make up the verb, the finite verb (i.e. the word is declined together with the subject) is the very last word in the sub-clause.
By changing the word order you can turn this subordinate clause into a main clause (which then is a complete sentence, no longer part of another sentence):
Jemand hat ihm sehr viel bedeutet.
Someone meant a lot to him.
The subordinate clause did begin with the relative pronoun der/who which did refer to jemandem/someone in the main clause. When turning the sub-clause into a main clause, then this pronouns also needs to be replaces by the word to which it did refer.
Auxiliary verb needed for »Perfekt« (a tense that is equivalent to past tense in English):
If you want to say "I went" in German, then this is »ich bin gegangen« in German. You have to add an auxiliary verb (here a form of sein (to be)) to the main verb (gegangen which is the past participle of gehen (to go)). So the verb consists of two words (bin gegangen), and this is also true for the verb in the subordinary clause of your sentence (hat bedeutet = meant):
hat
auxiliary verb, here a form of haben (to have)
This auxiliary verb is the verb that needs to be equal to the subject in number (here: singular) and person (here: 3rd person). This means, that this word has to be declined, which makes it the finite verb.
And since it is the finite verb, it must be at position 2 if it is in a main clause, and at the very last position if it is in a subordinate clause.
bedeutet
the main verb, past participle of bedeuten (to mean). This word doesn't have to be declined. So it is not a finite verb, but an infinite verb, and therefore stands at the end, in main and in subordinate clauses.
In subordinate clauses the finite and infinite verbs share the last position, and within this position its the finite verb that has the stronger right to stand at the end.
All this rules together are the reason, why the word order is as it is:
Vor drei Monaten musste er sich von jemandem trennen, der ihm sehr viel bedeutet hat.
Three month ago he had to break up with someone, who meant a lot to him.