This question requires two answers! The short answer is YES, you can get an STI from vaginal, anal, and oral sex. In your question, you say that both of you have been infected in the past but are currently ‘clean.’ What caught my attention was that you are no longer together, but remain friends. Since there is no commitment to a mutually monogamous relationship (neither one of you have sex with anyone else) there is the possibility that either of you may have sex with others and become infected again. Secondly, pulling out is not protection against pregnancy! There are several birth control options that you can discuss with your care provider. Additionally, you should insist on condom use each time you have sex to protect against sexually transmitted infections.
I would also like to address your relationship. You express love for your former boyfriend but from what I read, he does not share this feeling, which makes me concerned for you. What do you want from this ‘friends with benefits’ relationship? At 17, you have your whole life in front of you and I hope that you will take time to really think about what you want out of life and out of a relationship. Once you figure that out, share your feelings with this young man. If he does not or cannot commit to you, then you need to move on. Relationships can be difficult but when you find someone that shares your dreams and values, you can move forward together.