Nothing. Don't for a second think that you went wrong somewhere. What"s meant to happen will happen. Some people aren't meant to stay in your life and you find out the reason years later. May you find the courage to move on with your life. God bless you. :)
We tend to believe that if our dear ones leave us, it's because of us. But this is not true. The reality is that in a relationship of any kind, the fault and the responsibility lies in all people involved. So if they didn't stayed, chances are that anything you would've done better, you still couldn't hold them for too long. If someone wants to stay, to fight, to be better, they will stay without us trying too hard.
There is absolutely nothing you can do to make someone stay; he or she is responsible for himself of herself. When situations are out of control, you can only control what you can control in an out of control situation. Sometimes people leave. If you chase them, they will run; they may run anyway, but the reality is, if you chase them, THEY will run.
At times we like to think about the things we could have done, but the truth is nothing more could be done. If you knew in your heart that you were being everything you could possibly do, then it was enough. Everyone has different personalities and so people have different things to bring onto the table. People need certain types of personalities, that doesn't mean yours wasn't good enough. It just means you're amazing personality is for someone else that needs you.