Note the uses of the word Beasts in the description of what Wild Shape does.
Beasts is a defined term; from page 2 of the Dungeon Master Basic Rules:
Beasts are nonhumanoid creatures that are a natural part of the fantasy ecology. Some of them have magical powers, but most are
unintelligent and lack any society or language. Beasts include all
varieties of ordinary animals, dinosaurs, and giant versions of
animals.
You can Wild Shape into existing "Giant" animals
For Giant (x), if the creature meet the requirements of the Beast Shape table on page 66 and the Challenge Rating requirements on the same page, then the answer is yes, you can transform into a giant beast.
For example, a Giant Scorpion is described as
Large beast, unaligned
So it meets the Beast requirements, but its CR of 3 exceeds the maximum challenge rating of 1 for an 8th level druid. So you can't Wild Shape into a Giant Scorpion.
However, a Giant Poisonous Snake is CR ¼, so you can Wild Shape into this creature if you seen it before and are at least 2nd level.
You can't Wild Shape into swarms
As for a swarm, the answer is no. This conclusion hinges on the wording of both Wild Shape and the Swarm creature.
Wild Shape (PHB page 66) opens with
Starting at 2nd level, you can use your action to magically assume the
shape of a beast that you have seen before.
The plain reading means the druid character can shape into a single beast.
The swarm descriptions are formatted like this:
(swarm size) swarm of (creature size) beasts, (alignment)
For example a Swarm of Poisonous Snakes (DM's Basic Rules, page 46) is
Medium swarm of Tiny beasts, unaligned
So it clear that the "creature" is only treated as a single entity for the purpose of combat. It is really comprised of many creatures, whose action in concert gives the swarm its power.
My opinion is that they forgot to define or haven't finalized the definition of a swarm, which is why it doesn't appear in the list of standard creature types on page 2 of the 5e Dungeon Master's Basic Rules.
From the Monster Manual, p.165:
Goblins have an affinity for rats and wolves, raising them to serve as
companions and mounts, respectively. Like rats, goblins shun sunlight
and sleep underground during the day. Like wolves, they are pack
hunters, made bolder by their numbers. When they hunt from the backs
of wolves, goblins use hit-and-run attacks.
This is reported in the general description of Goblins. It does not mean that they can control rats and wolves like if they were using a spell like Dominate Monster (i.e. make them perform specific actions by command), but rather that they raise these beasts in order to make them friendly (like humans and dogs, or humans and horses).
Best Answer
Judging from this question, there are no rules for training animals, so right off the bat you are entering homebrew territory.
If your DM is willing, then maybe you could train rats to help you. You can use spells such as Beast Bond and Speak With Animals to try and communicate with them. Talk to them, bribe them, and train them using these spells. (Animal Friendship may not help much, other than to let you try to persuade it, which wouldn't work unless you are speaking with it.)
Disclaimer: A rat's INT score is 2. Training it may be very difficult.
All in all, it is up to your DM whether or not you can do this.