Any fantasy movie in a futuristic setting (even one that's technically in the past, like Star Wars) would be widely considered science fiction. Granted, that is a common definition of science fiction.
But science fiction can also be something like The Twilight Zone: a genre that explores "what-if" scenarios. A genre that takes some fictional premise and attempts to explore the consequences logically. An example premise could be, how might modern society have evolved if the Greek gods were real? A sci-fi story would try to approach that question in a scientific and logical way. Star Trek often followed this pattern. Star Wars doesn't.
A weakness of defining sci-fi by a futuristic setting is that you can change the genre with only superficial changes to the story. Other major genres - comedy, horror, mystery, romance, action - are defined by the feeling or thought process they try to evoke. But take Star Wars and replace the planets with kingdoms, the Jedi with wizards, and the force with.. well, that's fine as it is.. and you can create a story with the exact same plot points but without a futuristic setting. There's no actual science in Star Wars; only a futuristic setting.
Setting doesn't feel like it should be the feature that defines a genre. You should be able to have a comedy, horror or mystery take place in a futuristic setting and a sci-fi that takes place in the present (and we often do, eg, The Handmaid's Tale).
I'll note that there aren't many movies that stick to just sci-fi; most incorporate a lot of action (like The Matrix). This is probably because filmmakers feel 2+ hours of science fiction would be boring. The movie The Martian heavily cut from the science of the book and focused on the action (while the book had little action and a lot of science). You see a strong sci-fi focus more often in literature and TV.