How many type ratings are pilots allowed to hold at once? I think i've read that the B787 has a common type rating with the B767 and B777. But I also think I've read that pilots are only allowed to fly two types of aircraft at a time... 

So when they go to fly the 787, do they have to give up one of the their ratings if say they were previously allowed to fly the 767 and 777? Would the same still apply for say a B757 and B767 which have very similar flightdecks? 

EASA and FAA perspectives would be appreciated :)
There is no limit to the number of type ratings that a person can hold. The world record for most type ratings held by an individual currently stands at 105!

For safety reasons, most airlines only allow a pilot to be currently assigned to two aircraft types at one time so that they don't start to confuse the different airplanes and mix things up. This isn't a regulation though, at least in the US.

In your example, those airplanes are the same type so would only count as one of the two that they could be assigned to, but this will vary based on individual airline policy and the complexity of the differences between the actual aircraft involved.