The OnTriggerEnter function receives one parameter: The Collider the trigger collided with i.e. the other collider in the trigger collision besides the trigger.
I don’t see at the first glance why the first example doesn’t work but the second one is the way I would go. Comparing Collider objects doesn’t seem like a very clean solution to me.
Looking at the second example, I spot two errors:
There’s a unmatched “(” in the if.
GameObject is the class while gameObject is the variable name. Capitalization is important.
function OnTriggerEnter (other : Collider) {
if (other.gameObject.tag == "P1")
running = false;
}