Yes. Mark 7:21 records that Jesus said “For from within, out of the heart of men, proceed evil thoughts, adulteries, fornications, murders,” and in Matthew 15:19 Jesus said “For out of the heart proceed evil thoughts, murders, adulteries, fornications, thefts, false witness, blasphemies”. The English word “fornications” He used is translated from the Greek word porneia. Porneia is defined among other things as 1) illicit sexual intercourse,a) adultery, fornication, homosexuality, lesbianism, intercourse with animals etc. This clearly shows that Jesus did speak about homosexual behavior and considered it a sin.
I have no doubt he believed it was a sin, just curious as to whether he actually taught it. I can’t speak for Greek and the translation or what was meant by fornication.