If the target spell is an illegal target when Refute tries to resolve, it won't resolve and none of its effects will happen. You won't draw or discard.

Artwork
Loading artwork…
Refute
Star Trek Commander · #579 · EN
Nonfoil—Foil—
Card rules
Counter target spell. Draw a card, then discard a card.
"You're discussing tactics?! Do you realize what this really comes down to? Millions and millions of lives hanging on what this vessel does next!" —Dr. Leonard McCoy
Common · Illustrated by Mark Spears
Format legality
Alchemy Legal
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Future Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Penny Legal
Pioneer Legal
Standard Legal
Standard Brawl Legal
Timeless Legal
Tlr Legal
Vintage Legal
Old School Not Legal
PreDH Not Legal
Premodern Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions