output will contain the output features of the last layer in your rnn for all time steps, while hidden will contain the features for the last step.
This small code example shows the equality:

rnn = nn.RNN(10, 20)
input = torch.randn(5, 3, 10)
h0 = torch.randn(1, 3, 20)
output, hn = rnn(input, h0)

print((output[-1] == hn).all())
> tensor(true)


Dropout will drop output activations randomly as shown here:

lin = nn.Linear(10, 10)
x = torch.randn(1, 10)
out = lin(x)
print(out)
print(F.dropout(out, 0.5))