One day, I looked outside a window and saw a woman. Part of her breasts were visible. I saw it twice, but then I pulled my eyesight away knowing that it can be a sin to look such things as Jesus said, "if anyone looks at a woman lustfully, then you have already committed adultery with her." I want to know whether I have sinned?
If you were looking at her, wanting to have sex with her, then, yes, it was a sin. If you saw and were tempted to look further or tempted to start thinking about sex, then no it wasn't a sin, it was a temptation that you managed to resist. Temptation and lust are not the same thing.
Arousal is the natural reaction of your body to sexual stimulation, whether physical or mental. It is little different than your mouth watering when you smell your favorite dish being cooked. For more discussion on this, see "Why do men become aroused?"
Temptation is Satan trying to persuade you to sin. One method he uses is your natural physical reactions to lure you into a situation where it appears that to satisfy your desire you must break a law of God. The fact that you are tempted is not a sin. Jesus was tempted by Satan three times in the wilderness, once with a physical desire -- food -- yet, he did not sin. "For we do not have a High Priest who cannot sympathize with our weaknesses, but was in all points tempted as we are, yet without sin" (Hebrews 4:15).
Lust literally means a very strong desire, but we usually limited its usage to strong desires to do something sinful. Lust is the next step beyond temptation. It is when you seriously give consideration to do what is sinful. It is when you play out in your mind doing what is sinful, thinking of ways you might seemingly get away with it, but where you haven't yet taken action because of fear of getting caught or a lack of opportunity. In other words, lust is when you stop thinking of something as wrong and start thinking of it as a possibility. "But I say to you that whoever looks at a woman to lust for her has already committed adultery with her in his heart" (Matthew 5:28). It is wrong because you have broken a barrier in your mind that would prevent you from committing the sin. "What comes out of a man, that defiles a man. For from within, out of the heart of men, proceed evil thoughts, adulteries, fornications, murders, thefts, covetousness, wickedness, deceit, lewdness, an evil eye, blasphemy, pride, foolishness. All these evil things come from within and defile a man" (Mark 7:20-23). See the chapter "What is Lust?" for more details.
Thank you, sir. I knew that it was not a sin, but why it was troubling my mind saying to me, "You may have sinned, now you will lose the presence of God. Now there is going to be something bad for you." I kept on saying to myself that I have not sinned, but then why these doubts were attacking me again and again?
Because you put your emotions ahead of what you know. "He who trusts in his own heart is a fool, But whoever walks wisely will be delivered" (Proverbs 28:26). Emotions can be a warning signal, but they do not determine right and wrong. You need to increase your faith in what God says and not in what you feel. "So then faith comes by hearing, and hearing by the word of God" (Romans 10:17).