Rust is iron oxide. Sterling silver does not usually contain iron, so it cannot oxidize to form rust. However, sterling silver can oxidize to form silver oxide, which creates tarnish.
Sterling silver is an alloy of silver. It is made of 92.5 percent silver by weight. The other 7.5 percent of the alloy is made of other metals, most commonly copper. The copper and other metals alloyed with the silver can also oxidize to create tarnish. Sterling silver is harder than pure silver, making it useful for creating objects that are strong enough to hold their shapes. Sterling silver that has been made with metals other than copper is more resistant to tarnishing.