Sounds like you are talking about being in the "Friend Zone".
If you know someone is in a relationship it's not a good idea to allow yourself to become emotionally invested in them let alone confess your feelings.
It's an unrealistic romantic notion to believe he or she would suddenly dump their current partner for you. Even if they did and six months later another person told them they were in love with them you could end up being the next one dumped.
You're better off to find someone of your own. If ever the two of you are both "on the market" at the same time then you can make your move by telling them you always had a crush on them.