QuestionIf I have a sexual dream about a boy that I like, who doesn't have a girlfriend, is that a sin?
Whether the boy has a girlfriend or not doesn't matter. Dreams are something that you cannot directly control. When you sleep, your brain takes advantage of your "off" time to organize all the events and thoughts that you had during the day. One purpose of that organization is to connect past memories to current ones so that you can recall events. But sometimes those connections are a bit odd. That is why something that seems totally unrelated to the subject at hand suddenly pops into your mind. But those odd connections are also what triggers our creativity as well.
When you dream you are basically watching those connections being made. I suppose the boy that you dreamed about is one you have some interest in. That interest may have been connected to some movie that you saw or something suggested in a song or in a book, but then the people in the roles are substituted and small things are altered along the way. The result is a weird dream that you won't have purposely thought about while you are awake.
Daydreaming about having sex with a boy with whom you are not married is a sin. You are then filling your mind with ideas that are not proper. "But I tell you that everyone who gazes at a woman to lust after her has committed adultery with her already in his heart" (Matthew 5:28). Exchanging the role of the man and woman is still equally sinful.
But the only thing you can do about dreams at night is to avoid filling your mind with sexual garbage. Give your brain less sinful material to work with and dreams about sin will happen with less frequency. Not that it will ever go away because we all get exposed to ideas that we should not contemplate.