{% if products|length == 4 %}
    {% set columns = "col-6" %}
{% endif %}
{% if products|length == 3 %}
    {% set columns = "col-4" %}
{% endif %}
{% if products|length == 1 %}
    {% set columns = "col" %}
{% endif %}

<div class="row">
    {% for product in products %}
        <div class="{{ columns|default('') }}">
            {% include '@SyliusShop/Product/_box.html.twig' %}
        </div>
    {% endfor %}
</div>
