Look who figured out how to get attention from you! And judging by him making you post here, he's done a fine job of it. Face it, your dog has outsmarted you. Happens to me almost daily. ;-)
As you have already figured out, he's doing it to get your attention, and he's succeeding because you go chasing after him, right?
Time to outsmart your dog! Find an old sock you don't care about and make it a toy for him. Tie a knot in it so you both know which one it is. When you have the time, let him grab that one and make it a game to get it back. This will be the game and the attention he craves. (Yes, dogs not only play games but invent them, and "keep away" is an ever popular one.) When he grabs a real sock, completely ignore him. Do not try to get it back, do not even acknowledge he has it. Really, you must completely ignore his stealing of a real sock no matter what.
Pretty soon he'll learn that only The Sock gets attention. He'll learn to ignore the others, and now you have only one sock you need to control. It will take some time, probably weeks, but it will happen without undue stress to you or him and with no real major efforts.