One quick way to think about it is that you're transposing the entire problem. Imagine placing the primal coefficients in a matrix, with the objective at the bottom. This gives $P = \begin{bmatrix} 1 & -6 & 2 \\ 5 & 7 & -4 \\ 8 & 3 & \end{bmatrix}$. Transposing yields $P^T = D = \begin{bmatrix} 1 & 5 & 8 \\ -6 & 7 & 3 \\ 2 & -4 & \end{bmatrix}.$ Thus the dual (coefficients and variables only) looks like
$$
\begin{align}
\text{max or min } &2w_1 - 4w_2 \\
\text{subject to } &w_1 + 5w_2 \text{ ? } 8\\
&-6w_1 + 7w_2 \text{ ? } 3.
\end{align}
$$
Now we have to figure out whether we are maximizing or minimizing, what should go where the ?'s are, and whether the dual variables are nonnegative, nonpositive, or unrestricted. The table tells us all of this.
Since the primal problem is maximizing, the dual is minimizing. Everything else can be read by pairing rows with columns in the transposition: Row $x$ in $P$ goes with Column $x$ in $D$, and Column $y$ in $P$ goes with Row $y$ in $D$. Then the table says...
- Row 1 in $P$ is a $\geq$ constraint in a maximization problem $\Rightarrow$ The variable associated with Column 1 in $D$, $w_1$, has $w_1 \leq 0$.
- Row 2 in $P$ is a $=$ constraint $\Rightarrow$ $w_2$ is unrestricted.
- Column 1 in $P$ is for $x_1$, and $x_1 \leq 0$ $\Rightarrow$ The constraint associated with Row 1 in $D$ is a $\leq$ constraint.
- Column 2 in $P$, with $x_2 \geq 0$ $\Rightarrow$ The second constraint in the dual is a $\geq$ constraint.
Thus we get the complete form of the dual
$$
\begin{align}
\min &2w_1 - 4w_2 \\
\text{subject to } &w_1 + 5w_2 \leq 8\\
&-6w_1 + 7w_2 \geq 3 \\
&w_1 \leq 0 \\
&w_2 \text{ unrestricted.}
\end{align}
$$
For remembering how to do this, I prefer something called the "SOB" method instead of memorizing the table. "SOB" here stands for "sensible," "odd," or "bizarre." The SOB table is the following:
Variables Constraints, Maximizing Constraints, Minimizing
Sensible ≥ 0 ≤ ≥
Odd Unrestricted = =
Bizarre ≤ 0 ≥ ≤
Hopefully it makes sense why these are "sensible," "odd," and "bizarre," at least relatively speaking.
The idea then is that sensible maps to sensible, odd maps to odd, and bizarre maps to bizarre when you're switching from the primal to the dual. Let's take the example problem. It's "bizarre" to have a $\geq$ constraint in a maximization problem, so the variable in the dual associated with the first constraint, $w_1$, must have the "bizarre" nonpositivity restriction $w_1 \leq 0$. It's "odd" to have an equality constraint, and so the variable in the dual associated with the second constraint, $w_2$, must have the "odd" unrestricted property. Then, it's "bizarre" to have a variable $x_1$ with a nonpositivity restriction, so the constraint in the dual associated with $x_1$ must have the "bizarre" $\leq$ constraint for a minimization problem. Finally, it's "sensible" to have a variable $x_2$ with a nonnegativity restriction, so the constraint in the dual associated with $x_2$ must have the "sensible" $\geq$ constraint for a minimization problem.
I've found that after a few practice examples my students generally internalize the SOB method well enough that they can construct duals without needing to memorize anything.