Since Patch 1.03 the bug of randomly getting human form back after multiplayer sessions has been fixed. According to the patch notes, you now get some humanity back for helping others as a white phantom, meaning your health penalty will decrease. When all your health is back, you will regain your human form (I have just tested this). This means you are no longer dependent on human effigies to get your humanity back in online mode.
Patch note excerpt:
Players now receive a small portion of Humanity after successfully assisting in a Multiplayer session instead of regaining full Humanity.
Before Patch 1.03:
Before Patch 1.03, you got revived by playing co-op at random. It does not matter whether you defeat the boss or die, sometimes you will return to your world revived, although you placed your summon sign hollowed.
There are several rumours on the internet, that it gets less likely to revive the more often you fight the boss, or that the amount of human effigies you have has an influence on your chances to revive, but they are wrong.
I once got revived although the summoner died in a boss fight, and once it took six times killing a boss and then only one time killing the same boss to revive, although the circumstances had not changed.
This random procedure indicates, that you are not actually meant to revive. In From Software's twitter post, that has been partially translated at reddit, it has been confirmed, that phantoms reviving is a bug and not actually supposed to happen:
Somebody asked the official Japanese FromSoftware twitter if it was a bug that sometimes you didn't revive to human after helping somebody else play coop.
The answer? "Actually you're not supposed to revive to human, we'll investigate why that happens".
Human effigies are limited in Dark Souls 2, as long as you don't use Bonfire Ascetics, which practically turn areas into New Game + difficulty, but as long as you use them rarely and with care, you shouldn't run out of them. You can find a lot of them as treasure and they also drop from (limited) enemies. For more information on that, see How do I farm Human Effigies?.
Should you find yourself running out of effigies anyway, you can either try to find the Ring of Life Protection, which makes you practically immortal as it can be repaired, or you could try to get summoned and ask other players through private messages to give you an effigy.