“Fortunately the judge ruled in my favor.”
You once got sued by a customer of your home business. You're telling someone the story of what happened. You've explained all of the background information, and this was the result.
Fortunately the judge ruled in my favor.
Use "fortunately" to describe situations that almost turned out badly, but turned out well instead.
In a court case, a judge or jury decides who wins. To talk about the result of that decision, you say that they "ruled in (the winner's) favor". In the same way, an official decision by a judge or a committee is called "a ruling".
The opposite of "ruling in someone's favor" is "ruling against" someone.