There is no hard and fast rule for deciding what to set u equal to. Rather, it is one of those things one learns by experience. A useful—although not 100% reliable—rule of thumb is this:

Put u equal to the expression that is being raised to an exponent or occurs in the exponent.