Something is deemed to have been published if it’s been made available to other people in written form. So if you write a letter, and let your friends read it, then there’s an argument to say it’s been published. However, as far as publishers go, if you use a POD company to print yourself a few copies but don’t let anyone else buy copies, then that should be pretty safe (although I’d not risk it), whereas if you buy your self-published book an ISBN and stick it up for sale on Amazon then that’s your first rights gone for good, no arguing. I’d say that selling the work, in no matter what form, means the first rights have been used. Magazine publication, no matter how small the circulation, takes first rights even if the magazine isn’t sold, but handed out for free. If a piece is included in an anthology then yep, again, first rights are gone. If you put up a rough draft online where it’s NOT publicly available, and then edit it, nope, you’ve still got your rights because the piece is NOT available to all and you’ve gone and made changes, so now it’s different.
There. Clear as mud.