To sample four random numbers summing to $100$, you can use the Dirichlet distribution with $k=4$ and $\alpha=(1,1,1,1)$. Here is an easy way to sample from this distribution, according to wikipedia.
First, choose three numbers $A_1,A_2,A_3\sim \text{Uniform}(0,100)$, independently.
Let $B_1,B_2,B_3$ be the result of sorting $A_1,A_2,A_3$ in increasing order. So, $B_1=\min(A_1,A_2,A_3),B_2=\text{median}(A_1,A_2,A_3)$ and $B_3=\text{max}(A_1,A_2,A_3)$.
Finally, define
$$
X=B_1,\quad Y=B_2-B_1,\quad Z=B_3-B_2,\quad W=100-B_3.
$$
Clearly, $X+Y+Z+W=100$ always. You can check that $X,Y,Z,$ and $W$ all have the same probability distribution. The common cdf of these four random variables is
$$
F(x)=P(X\le x)=1-(1-x/100)^3.
$$
Here is a complicated method to accomplish the same task. We will choose four numbers $X,Y,Z,W$ such that $X+Y+Z+W=2$ always, and such that each variable has the same distribution. This time, the common distribution will be uniform, $X\sim \text{Unif}(0,1)$. If you then scale up everything by a factor of $50$, you then get four random variables summing to $100$, where each is uniform on $(0,50)$.
Let $x_1,x_2,x_3,\dots$ be the sequence of base-$4$ digits of $X$. This means that $x_i\in \{0,1,2,3\}$ for each $i\in \{1,2,3,\dots\}$, and that $X=\sum_{i=1}^\infty x_i\cdot (1/4)^i$. Define $y_i,z_i,$ and $w_i$ similarly. We are going to choose $X,Y,Z,W$ by simultaneously choosing all of the base-$4$ digits of all four variables.
The idea is that, for each $i\ge 1$, the $4$-tuple of digits $(x_i,y_i,z_i,w_i)$ will be chosen uniformly from the $4!$ permutations of $(0,1,2,3)$. Note that $X$ will be $\text{Unif}(0,1)$, because $X$ has uniformly random base-$4$ digits. Furthermore, it will always be the case that
$$
X+Y+Z+W=\sum_{i=1}^\infty (0+1+2+3)(1/4)^i=6\times \frac{1/4}{1-1/4}=2.
$$