SEBITOS, your sentence is an example of what is often called the "Third Conditional", an imaginary/ hypothetical situation in the past. The condition is therefore impossible to happen.
1. If I had studied harder, I would have passed my exams.
2. I would have passed my exams if I had studied harder.
Both sentences mean that I didn't study hard enough and I didn't pass my exams.
We use the past perfect in the "if" clause and would/ could/ might+ have+ past participle in the main clause.
When we start the sentence with the "If" clause, we use a comma between the two clauses (the first sentence). When we start it with the main clause, we do not put a comma before "if" (the second sentence).