Example 6 Find the maximum number of elements in a set $S$ that satisfies the following conditions:
(1) Each element in set $S$ is a positive integer not exceeding 100;
(2) For any two distinct elements $a, b$ in set $S$, there exists an element $c$ in $S$ such that
$$
(a, c)=(b, c)=1 \text {; }
$$
(3) For any two distinct elements $a, b$ in set $S$, there exists an element $d$ in $S$ different from $a, b$ such that
$$
(a, d)>1,(b, d)>1 \text {. }
$$
Each positive integer can be expressed as
$$
n=2^{k_{1}} \times 3^{k_{2}} \times 5^{k_{3}} \times 7^{k_{4}} \times 11^{k_{5}} q,
$$

where $q$ is coprime with 2, 3, 5, 7, and 11, and $k_{1}, k_{2}, \cdots, k_{5}$ are non-negative integers.
Let $A=\left\{n \leqslant 100 \mid k_{1}, k_{2}, \cdots, k_{5}\right.$ have exactly one or two non-zero values\}.
By definition, set $A$ clearly satisfies condition (1).
For any $a, b \in S$, since $a$ and $b$ are each divisible by at most
$$
P=\{2,3,5,7,11\}
$$

two integers, there exists $p \in P \subseteq S$ that is coprime with both $a$ and $b$. Taking $c=p$, we see that set $A$ satisfies condition (2).
Furthermore, if $a$ and $b$ have a common factor $u \in P$, then $p u \in A, p u \neq a, b$.
Taking $d=p u$, we see that set $A$ satisfies condition (3).
If $a$ and $b$ do not have a common factor in $P$, and they have factors $v, w \in P$, then $v w \in A, v w \neq a, b$. Taking $d=v w$ also shows that set $A$ satisfies condition (3).
Therefore, set $A$ satisfies the given conditions.
By the principle of inclusion-exclusion, we have
$$
\begin{array}{l}
|A|=\sum_{i \in P}\left[\frac{100}{i}\right]-\sum_{\substack{i, j \in P \\
i < j}}\left[\frac{100}{i j}\right]+\sum_{\substack{i, j, k \in P \\
i < j < k}}\left[\frac{100}{i j k}\right]-\sum_{\substack{i, j, k, l \in P \\
i < j < k < l}}\left[\frac{100}{i j k l}\right]+\left[\frac{100}{2 \times 3 \times 5 \times 7 \times 11}\right] \\
=50+33+20+14+9-(16+10+7+5+4+3+2)+(3+2+1+1+1)-(0+0+0+0+0)+0 \\
=126-47+8-0+0 \\
=87.
\end{array}
$$
Since $2 \times 3 \times 5 \times 7 \times 11 > 100$, there does not exist such a $d$. There are 21 prime numbers greater than 10 and less than 100. Let
$T=\{1,2, \cdots, 100\} \backslash\{1$ and prime numbers greater than 10 $\}$.
We will prove that at least seven numbers in set $T$ do not belong to

set $S$, thus, $|S| \leqslant 100-1-20-7=72$.
(i) If set $S$ does not contain any prime number greater than 10, then the smallest prime factor of each number in set $S$ is one of $2,3,5,7$. By condition (2), if $a b$ is divisible by $2 \times 3 \times 5 \times 7$, then $a$ and $b$ cannot both belong to set $S$. Therefore, at least one number in each of the following seven pairs does not belong to set $S$:
$$
\begin{array}{l}
(3,2 \times 5 \times 7),(5,2 \times 3 \times 7), \\
(7,2 \times 3 \times 5),(2 \times 3,5 \times 7), \\
(2 \times 5,3 \times 7),(2 \times 7,3 \times 5), \\
\left(2^{2} \times 7,3^{2} \times 5\right) .
\end{array}
$$
(ii) If set $S$ contains a prime number $p$ greater than 10, then the smallest prime factor of each number in set $S$ is one of $2, 3, 5, 7, p$. By conditions (2) and (3), we know:
1) When $7 p \in S$,
$2 \times 3 \times 5, 2^{2} \times 3 \times 5, 2 \times 3^{2} \times 5 \notin S$;
while $7 p \notin S$, $7, 7^{2}, 7 \times 11, 7 \times 13 \notin S$.
2) When $5 p \in S$, $2 \times 3 \times 7, 2^{2} \times 3 \times 7 \notin S$;
while $5 p \notin S$, $5, 5^{2} \notin S$.
3) $3 p$ and $2 \times 5 \times 7$ cannot both belong to set $S$.
4) $2 \times 3 \times p$ and $5 \times 7$ cannot both belong to set $S$.
5) When $5 p, 7 p \notin S$, $5 \times 7 \notin S$.
When $p=11,13$, by 1) to 4), we know that at least $3+2+1+1=7$ numbers in set $T$ do not belong to set $S$;

When $p=17,19$, by 1) to 3), we know that at least $4+2+1=7$ numbers in set $T$ do not belong to set $S$;

When $p \geqslant 23$, by 1), 2), and 5), we know that at least $4+2+1=7$ numbers in set $T$ do not belong to set $S$.

In summary, the maximum number of elements in a set $S$ that satisfies the given conditions is 72.