So would something like this work?
library(tidyverse)
df_group <- data.frame("Product" = c(1,2,2,2,1,2),
"Count" = c(25,10,20,35,22,18),
"Year" = c(2020,2020,2019,2019,2018,2018),
"Customer" = c("A","B","A","B","A","B"))
df_group %>% group_by(Year) %>% top_n(1, Count)
#> # A tibble: 3 x 4
#> # Groups: Year [3]
#> Product Count Year Customer
#> <dbl> <dbl> <dbl> <chr>
#> 1 1 25 2020 A
#> 2 2 35 2019 B
#> 3 1 22 2018 A
Created on 2021-10-21 by the reprex package (v2.0.0)