How do I change the color of a gameobject based on number of collisions?

I am trying to change the color of a gameobject based on the number of collisions it is in.
With this code, I get the error message: cannot implicitly convert type ‘int’ to ‘bool’

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ChangeColorOnCollision : MonoBehaviour
{
    int counter = 0;

    void OnCollisionEnter(Collision col)
    {
        counter ++;
    }

    void Update()
    {
        if (counter = 1)
        {
            transform.GetComponent<Renderer>().material.color = Color.blue;
        }

        if (counter = 2)
        {
            transform.GetComponent<Renderer>().material.color = Color.red;
        }
    }
}

line 16 and 22 need to be if(counter == number) not if(counter = number)