This question already has an answer here:
I'm making a game in XNA and I want to limit the movement of a sprite to the screen boundaries. How would I do this?
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
The simplest way, if you just want the sprite to not go off the screen is this