This would be the test for the eventuality that d$y contains a value of 1 in any of the rows where d$x==2:
any( d[d$x==2, "y"] == 1 )
If that eventuality holds, then return a dataframe that has removed all the d$x==2 rows using some Boolean algebra and logical indexing:
d[ !as.logical( d$x == 2 * any( d[d$x==2, "y"] == 1 ) ) , ]
(Note: the value of 2 did not meet the narrow condition you set.)
If you wanted to apply that rule to all the unique values of d$x and apply a more general exclusionary condition of no y > 0
lmat <- t( sapply( unique(d$x) , function(val)
as.logical( d[["x"]] == val * any( d[d[["x"]]==val, "y"] > 1 ) ) ) )
# Now use `any` to determine which rows to exclude.
# One does need to transpose that matrix of excluded logicals.
d[ ! apply( t(lmat) , 1, any), ]
x y
2 2 -1
4 2 -1
6 1 -1
13 2 -1
14 9 -1
20 2 -1