As far as I'm aware, Pokerus is generated randomly.
Horde battles do increase the chances of getting pokerus. In my pokemon Y game, my starter pokemon was infected outside the daycare after 12 horde battles, whereas in pokemon white2, it took me almost to the end of the game, by the time I got Victory Road, for my pokemon to be infected with it.
Eggs can be infected with Pokerus so that when they hatch the pokemon will have the virus.
As for trading, I'm not 100% sure. Maybe if the pokemon comes from an old game, like FireRed or something, the chances may be increased slightly.
Fossil pokemon can't be revived with the virus as far as I'm aware. I've never heard of a fossil pokemon being revived and being infected at the same time.
Again, cross-contamination from party pokemon would pass the virus to gift pokemon.
Generally speaking though, Pokerus is a completely random event. You should check the GTS, someone there will be offering a pokemon with Pokerus, or even random wondertrades. I have sent out baby pokemon infected with the virus.