Regarding the first question:
This is the kind of situation in which a binomial distribution would occur: if there's $p$ probability of an event occurring one of $r$ times in a sequence, you need to account for the number of sequences that also have that event occurring.
For example, say I flip a coin $5$ times: how many times does it pop up heads $2$ times? Well, first, how many sequences of $5$ flips have $2$ heads appearing? That's $\binom 5 2$. From there, the probability of $2$ successes is the probability $p$ of flipping heads, to the power of $2$, times the probability $1-p$ of instead flipping tails, to the power of $5-2=3$.
More concretely, the probability is given by
$$P(\text{2 heads in 5 flips}) = \binom 5 2 p^2(1-p)^3$$
Note that I did not explicitly say $p=1/2$ for a reason, that being maybe I'm not flipping a fair coin. My motivation for doing this is because I don't want you to get some wires crossed in your head with how the calculation is performed, so I want to reiterate - my coin is not necessarily fair in this scenario.
Okay, so let's say I want at most $2$ heads. We can simply generalize the above: find the probability of $0,1,$ and $2$ heads; i.e.
$$\begin{align}
P(\text{at most 2 heads}) &= P(\text{0 heads}) + P(\text{1 heads}) + P(\text{2 heads})\\
&= \binom 5 0 p^0(1-p)^5 + \binom 5 1 p^1(1-p)^4 + \binom 5 2 p^2(1-p)^3\\
&= \sum_{k=0}^2 \binom 5 k p^k(1-p)^{5-k}
\end{align}$$
In general: say we have a sequence of $n$ trials, all independent from each other. We define the outcome of each to be a success or failure, with probabilities $p$ and $1-p$ respectively. Then the binomial distribution says that the probability of $r$ successes (where $r$ is an integer from $0$ to $n$) is given by
$$P(r \; \text{successes}) = \binom n r p^r (1-p)^{n-r}$$
If we want "at most" some number of successes, at least, or whatever, we simply sum the above repeatedly, using whichever $r$ values are the most applicable.
In your scenario, OP, $n=5, p=1/30.$ In the first question, we want $r\geq 2$ (so sum over $r=2,3,4,5$).
If you want to look into this topic further, Khan Academy is probably a good resource to start. Here's a link.
The second question is more benign than the above binomial distribution problem, in my opinion. Consider the complementary approach - what is the probability of not having a repeat? There are $30(29)(28)(27)(26)$ ways of choosing students to avoid repeats; divide that by the total number of possible student selections, $30^5$, and that gives you the probability of not having a repeat student. Thus the probability of a repeat is $1$ minus that.