If you are really confused and cannot decide. Take a break, move out and cut contact with both of them until you have your mind made up. I think if you dump your bf for someone else you will regret it. So break up with him to be alone for awhile and see if there is any way back if you start to regret it.
I think you should stay away from your friend completely. Hes not a good friend to do this to you when he knows you are in a happy long term relationship.
I also think you were probably very content and happy until he pushed himself in between you.