If you have a fever above 100, are vomiting, or would not be able to commit to sitting upright at your desk for a reasonable amount of time (you’d need to be in the bathroom, you’d need to be curled on the floor in the fetal position, whatever) then you should stay home.
Which is basically my list for either you are contagious or cannot perform your duties. It’s a real pain in the ass for my employer if I don’t come in, so I have to be pretty much dead. Having said that, I took a sick day for really horrible cramps once. Of course then they cleared up around noon and I spent the rest of the day feeling horribly guilty about it.