In this work, we provide a necessary and sufficient condition on a polyomino ideal for having the set of inner 2-minors as graded reverse lexicographic Gröbner basis, due to combinatorial properties of the polyomino itself. Moreover, we prove that when the latter holds the polyomino ideal coincides with the lattice ideal associated to the polyomino, that is the polyomino ideal is prime. As an application, we describe two new infinite families of prime polyominoes.