Let's assume the bottle is completely full (i.e. it acts as a rigid body and essentially ignores air resistance), and that it is initially held horizontally, by the cap, and thrown straight upward. Then you'll need four things:
The initial height $h$ above the landing surface,
The distance $d$ between the bottom of the bottle and its center of mass,
The initial vertical velocity $v_0$, and
The initial angular velocity $\omega$ about the bottle's center of mass.
Since air resistance is ignored, there is no torque on the bottle while in the air; as such, it rotates with constant angular velocity $\omega$ the whole time. Requiring that the bottle lands upright is equivalent to saying that the total angle rotated in flight is equivalent to $3\pi/2$ (since the bottle, when flipped, rotates in a manner such that the cap is the first end to face the ground). This constraint is equivalent to:
for flight time $t$ and some integer $n\geq0$. Now, since the bottle is a rigid body, gravity acts as if it were a point mass. As such, the flight time can be calculated from the normal kinematic formula:
taking the height of the landing surface itself to be 0. Using the quadratic formula,
Since we require a positive time, we must choose the minus sign in the $\pm$, making it
Plugging this into our earlier constraint, we see that for a given $v_0$ and $h$,
so there are a multitude of possible angular velocities that will guarantee a landing. For the minimum angular velocity, set $n=0$.