Zählen Sie Elemente mit CSS, wenn Sie nur nur 2 - nicht mehr oder weniger haben

  .cards-row:first-child:nth-last-child(2),
  .cards-row:first-child:nth-last-child(2) ~ .cards-row{
    margin-bottom: 2.2rem;
  }
Matt Miller