3 bit synchronous counter design d flip flop
The key thing is to treat each bit individually.

For example, for the low-order bit, lets call it next_state[0].

state     | next_state[0]
---------------
   000    | 0
   001    | 0
   010    | 1
   011    | X
   100    | 0
   101    | 0
   110    | 0
   111    | 1


So you can write 

next_state[0] = state[0] &amp;  state[1] &amp; state[2] | ~state[0] &amp; state[1] &amp; ~state[2]

If you are building this with discrete logic you could simplify this to 

next_state[0] = state[1] &amp; (state[0] &amp; state[2] | ~state[0] &amp; ~state[2])

And you have an equation you can use to drive the flip-flop that will generate the next condition for the low-bit of the state variable.

Finding the equations for the other two state bits works the same way.