Sometimes, when writers feel the need to avert Terrorists Without a Cause, they use this stock motivation, where the members of a guerilla/insurgent/terrorist/freedom fighter/resistance/etc. movement and/or organisation justify their actions by claiming they desire for foreign occupiers to leave their nation. This is both Truth in Television and Older Than Feudalism, dating at least back to the 1st century BCE with the Sicarii zealots in Roman-occupied Israel.
A rather peculiar case of this trope occurs with some Animal Wrongs Groups, who claim humans are occupying the Earth.
The Kaleesh, General Grievous' people, joined the CIS largely because their own planet had been economically ruined by the Republic for retaliating (with massacres) against the rival Huks, who had invaded their planet and enslaved the Kaleesh
A series of insurgent operations on Manaan by the native Selkath managed to drive The Empire offworld (though, much like the Rebel Alliance, they received help from Darth Vader.)
The films themselves, too. The first one in particular has been viewed as an allegory for the Vietnam War, while Revenge of the Sith was seen as an Iraq War allegory. Lucas actually confirmed the Vietnam connections, but denied any intentional Iraq allegory.
The Guiding Hand in Feng Shui is based upon the kind of Well Intentioned Extremists and out-and-out Knight Templar-ish people that made up the Boxers at the turn of the century, and if you want to see just how nasty these guys can get, well, look no further than Once Upon A Time In China 2 which pits Wong Fei Hong played by Jet Li against the fanatical and Nazi-like White Lotus sect, and which shows us the other side of the coin by raising issue with rabid anti-western bigotry instead of foreign imperialism and greed with the first movie.
The V franchise (no, not that V). A human resistance group tries to expel the aliens who have taken control of Earth.
Generally, any work which portrays The American Civil War and especially the Reconstruction from the perspective of the South will ignore or sideline the issue of slavery and instead focus on this trope.
Anime and Manga
The Black Knights and other groups fighting the Britannian occupation of Japan in Code Geass. However, the leader of the Black Knights has a more complicated motivation.
The Zeons from Mobile Suit Gundam and its numerous sequels have a long and complex relationship with this trope. Though they started as an independence movement trying to gain sovereignty for the space colonies, they ended up as an oppressive imperialistic force that conducted a brutal invasion of Earth, while at the same time allying itself with various nationalist movements, primarily in Africa, that wanted independence from The Federation, putting them in the unique position of being occupiers and fighting a different set of occupiers at the same time. After the original series the Zeon home colonies get saddled with a nominally autonomous Federation puppet government while military remnants of both the Zeon forces and the nationalists they provided equipment to continue to be a thorn in the Federation's side up until the era of Gundam F91 and even try invading or destroying Earth again a few more times.
Billy Wilder's One, Two, Three with the "Yankee / Russkie go home" balloons.
Subverted in Monty Python's Life of Brian, where the aforementioned zealots are too busy squabbling amongst themselves (when the Romans aren't correcting their grammar) to do much. Particularly the Popular Front of Judea.
Although the People's Front of Judea are a bit uncertain about which Romans they want to go home (they rather like the ones who maintain trade, infrastructure and utilities).
The Wind That Shakes the Barley is all about this, during the War of Independence in Ireland. It doesn't paint anybody solid white, but the guys that deviate from solid Resistance action are definitely not regarded well compared to the stalwarts, and never mind England. Historical figures, incidentally.
Lampshaded in Red Dawn 1984, when the Wolverines are going to shoot their prisoners.
City of Craftspeople features some tranforms the setting into Middle-Age Europe, with invaders looking just like the aforementioned Teutonic Order.
Inverted in Ninth Company, which plays in Afghanistan - and the Soviet troops are the occupiers.
North Korealoves to set films in the early twentieth century, during the period of colonial Japanese rule over Korea. And, of course, North Korean films about The Korean War cast Americans as this trope, which North Korean propaganda argues is still ongoing. However, the Japanese seem to be North Korea's favorite historical villains.
The White Lotus sect mentioned above from Once Upon a Time in China 2 are singularly nasty Knight Templar types who want all foreign influence, however beneficial, out of China. These guys are introduced by burning a dog because it was a foreign breed, attack and burn down a foreign language school, forcing Wong to take the displaced students of the school to the British consulate, and at one point, they even burn a cross in front of the consulate in a scene that may remind American viewers of another sect known for its bigotry and intolerance (though with far different goals than the White Lotus).
Colonel Kurtz describes this in Apocalypse Now. In his haunting speech to Captain Willard, he claims that the reason why America is eventually going to lose the war is because to America the war isn't a matter of life and death—the Americans viewed Vietnam as a matter of containing Communism in the larger Cold War, while the Vietnamese wanted the Americans out of their country so much that they were willing to do whatever it took to win. Kurtz commends them, saying that if he had even so much as 10 divisions (about 100,000-200,000 troops) of men like that willing to do whatever was necessary to win, then the Vietnam War could be won with alarming speed.
Sixth Column. After the U.S. is invaded by the PanAsians, a group of U.S. soldiers forms an underground army (under the guise of a religion) to drive them out.
The short story "Free Men," which appears in several different anthologies, including Expanded Universe and The Worlds of Robert A. Heinlein. In this story, the invaders' identity is never specified.
Jerry Pournelle's story Sword and Sceptre. A rebel group on the planet New Washington hires Falkenberg's mercenaries to help remove the invading troops from their sister planet Franklin.
Komarran terrorists in the Vorkosigan Saga, a rare case where the protagonist is one of the occupiers. The circumstances leading up to the occupation also involve a lot of Grey and Grey Morality.
The Barrayarans themselves, including Miles' grandfather, fit this trope themselves a few generations before the books in question.
The Riftwar Cycle has this as the given reason the moredhel (dark elves) hate humans. Which makes sense, really, given that said occupation has driven the moredhel to live in the barren Northlands where they have to slaughter each other over scraps of food.
The motivation of much of the Syrian rebels in The Egyptian. Although Sinuhe doubts the sincerity of their motives.
Used frequently in the works of Harry Turtledove, for example, the Canadians resisting American occupation in Timeline191, or the English resisting the Spanish in Ruled Britannia.
Two of the earliest BattleTech novels, Decision at Thunder Rift and Mercenaries Star, involve a small force successfully doing this.
Given how often planets get occupied as a matter of course in the universe, this actually happens quite a bit. It's also one of the collective hats of the Capellan Confederation in particular — if a world they don't currently control ever was Capellan (or can be retconned as once having been Capellan by the official propaganda, they're not that picky), then it doesn't matter how much time has passed and how its current inhabitants feel about the matter, the official stance is that it still belongs to the Confederation and they want it back.
In the Star Trek: Deep Space Nine Relaunch, the True Way movement on Cardassia equates Federation and Bajoran aid movements with cultural imperialism, accusing them of attempting the final destruction of traditional Cardassian culture, and using terrorism to try and force them offworld. Also, on Trill, unjoined political groups come to see the Trill symbionts as a manipulative race of overlords controlling Trill society; after all, the Joined hold all the positions of overt political authority, and as far as some unjoined are now concerned, the humanoid Joined are puppets of the symbionts.
Lampshaded when a disfigured victim of one of Kira's bombs who has killed every member of her old resistance cell in revenge confronts her with the fact that he was just a civilian who did the laundry. Kira's reply is to simply point out that he was civilian who did the laundry for an occupying military force that had enslaved her entire planet and species!
Kira:"None of you belonged on Bajor. It wasn't your world. For fifty years you raped our planet, and you killed our people. You lived on our land and you took the food out of our mouths, and I don't care whether you held a phaser in your hand or you ironed shirts for a living. You were all guilty and you were all legitimate targets!"
Not for nothing does Kira admit that she was a terrorist in those days.
The Narn Resistance against the Centauri occupation of Narn in Babylon 5.
Tom Zarek's movement to repudiate the Colonial federal government from his homeworld of Sagittaron, which led to Zarek destroying a government building to achieve his ends and being imprisoned for it.
A resistance movement arises on Caprica in order to attempt to expel the Cylon occupiers, which Helo, Boomer and Starbuck all make contact with at some point. They get rescued in the season two finale. The Cylons decide to leave the 12 Colonies.
The anti-Cylon resistance movement on New Caprica, who justify their attacks (particularily their Suicide Attacks) on several grounds, among which are expelling the Cylons from their planet.
In the Europa Universalis expansion InNomine you'll get two kinds of these types of rebels: "Patriots" seek to have areas of a certain culture defect to another state with that culture. (eg. french patriots in provinces owned by the Netherlands will try to defect to France) Nationalists support a particular nation-state, and either want to defect to that state if it exists, or recreate it if it doesn't.
Half-Life 2 focuses on liberating Earth from the Combine.
A fairly prominent part of the in-universe history in Dragon Age: Origins, where Big Bad Loghain's personal xenophobia and Paranoia Fuel largely stems from his time as a La Résistance fighter struggling to throw the Orlesians out of Ferelden. Although he's shown to be right in at least one occasion that Orlais will try to conquer Ferelden again.
The story of Valkyria Chronicles follows the exploits of a militia squad - well, Welkin says it best :
Welkin: Let's drive these Imperials back out of Gallia! Squad 7, move out!
The first part of Fire Emblem: Radiant Dawn focuses on the Dawn Brigade's efforts to force Begnion's oppressive occupation army out of Daein.
The civilians caught in the crossfire between Soviet and NATO troops in Operation Flashpoint. The game's Resistance expansion pack is all about this trope and its campaign deals with it in a surprisingly nuanced matter.
Kicking The Empire out of Morrowind is part of Dagoth Ur's plan and he's been staging a series of assassinations to disrupt their activities since awakening.
Likewise, the Stormcloaks in Skyrim want The Empire out of Skyrim, although their plans aren't evil like those of Dagoth Ur.
This is ultimately revealed to be the motives of the Charr in Guild Wars, seeking to drive out the humans who occupied the ancestral Charr homeland of Ascalon. Also the motives of the centaurs in Guild Wars 2, again seeking to drive humans out of their ancestral homeland of Kryta.
In Avatar: The Last Airbender, a combination of this and revenge is the motivation for Jet's freedom fighters. They're portrayed less than positively, due to their willingness to kill even civilians to reclaim their land.
This is also the main source of conflict in "The Promise" comic book continuation. After the war ends, the Earth Kingdom forces all Fire Nation colonies out, only to discover that after generations of living there, people are less than willing to leave. Eventually, they make these areas new neutral zones, neither belong to Earth or Fire. The largest of these becomes Republic City.