Depends, are they a happy couple, or unhappy? If they are happy then just leave it be. The last thing you want is interfering with love, it only makes you look bad. If they are unhappy, then just talk to the boy. Don't try to squeeze it in that you like him because he could be going through a lot. Just talk because he might need someone to just listen. Ive seen it happen before, he might just pick up some feelings for you during that little talk. Afterwards just start hanging out more. BUT. These rules do not apply if you are in High School, you are a freshman and he is a senior. DO NOT go after him. You will cause a problem. Trust me. Heed my warning. I had to learn the hard way.
The best thing to do is to leave the guy alone and forget about him. Being in a relationship for two years is not a simple task and signifies that he is planned to settle with her. Move on with your life and find things that will occupy your mind other than the man.