Which one wins?
I had 77 in my hand.
He had J8 in his hand.
Community Cards on table:
8 8 7 2 2
So who wins here?
In a full house, 888xx beats 777xx. That is, the higher set beats the lower without concern for what the pair is. The cards in the pair are only important if both players have the same set, such as player A's pocket being 8 2 and player B's pocket being 8 7. This would give player A 88822, and B 88877.
A full house consists of a 'three of a kind' and a 'two of a kind' (='pair'). The one with the highest 'three of a kind' would have the highest full house. An example: Consider you have A2 and the other player has KQ. The board is: AA2KK. That would make a full house for you: AAA22 and your enemy as well: KKKAA. Still your full house is better and will win.
On your example you got unlucky since your enemy needed the remaining 8 or a J or any pair on the board. The latter happened.