Rust does not give you tetanus.
However rust can contain the bacteria that causes tetanus.
So if you get cut by rusty metal or step on a rusty nail the rusty nail or metal can contain the tetanus bacteria which is actually what gives you tetanus.
You can even get tetanus from stepping on a clean nail or getting cut with a clean piece of metal.
However you're more likely to get tetanus when stepping on a rusty nail or cutting yourself with a rusty piece of metal.
To prevent tetanus you should get a tetanus shot every 10 years and if you haven't had a tetanus shot within 10 years and you got cut especially with rusty metal or a rusty nail you need to get a tetanus shot.
Tetanus can be deadly if you're not vaccinated for it and you get it and leave it untreated.