Fantasy is the same, except that instead of science you have some form of magic as part of the plot.
Then you can mix to create a hybrid of sorts. Of which, because of the Force one could make an argument that Star Wars is a hybrid. Except that it is part of canon that there is scientific reasoning for it all.
I prefer this definition, too, but by it, quite a lot of Trek stories (even just the canon, on-screen stuff) are space fantasy of the same type as Star Wars; there's lots of SF-by-that-definition in Trek, too, which Star Wars pretty much completely avoids, but its not a black-or-white, all-or-nothing distinction with ST purely on the SF side of the fence.
Trek is about how science affects society. Quite often there's some dilemma thrown up by by technology, and the characters have to deal with it. The characters are ordinary people who happen to have some training and some intelligence, working in groups.
Star Wars is an opera. You have heroes, with heroic skills, fighting epic battles of historical significance. It's very much about individuals, and not terribly much about groups. Technology is purely incidental in Star Wars. We have light sabres, so let's have a duel where we can investigate some emotions.
If Lucas hadn't thought of light sabres, but just given them samurai swords, not much would change in your assessment of the world. You'd think the same of the characters, and it would be just as entertaining.
If Trek didn't have FTL travel, it would be a very different show.
Star Wars = Fantasy.
Science fiction answers the question "What if science?". It explores how the human condition may react to the new circumstances presented by advanced science. That's why it is almost universally set in the future, even where quazi-magical (Dune).
But Star Wars separates itself from frame one. What is the first thing lucas says in star wars? "A long time ago..." so this isn't anything that might happen in the future. And "in a galaxy far far away" ... it isn't anything to do with us. Lucas couldn't be more blatant. Star Wars is not science fiction.
It's basically LOTR+lasers.