[H] PP vs TT help

To all the professionals out there that's willing to help us noobs out. My buddy and I both use protoss and whenever we go against 2 Terran players, we die early game when they rush with marine/marauders. Now we have both tried all sorts of strategies such as 2 gate rush, 4 gate rush, cannon rush, cannon defend. We even tried our best to build fast stalkers but by then the enemy has mass marines and a few marauders. So my question is how to properly either attack or defend against early marines/marauders. If we are late in the game there is no problem but when they rush we always have a problem.