The script has several structural problems. Make sure that each while loop is delimited properly with do-done, and make sure all the if-statements are properly balanced. Indented spacing helps readability, and of course this web site strips indentation unless you force it not to.
Some notes on my version below ...
Use = for string compares and -eq for numeric compares. And the code would never get to your Bye Bye because the command above it would break out of the loop before it executes.
Your code has too much redundancy. In the following pseudo code, the else branch is taken when the condition is false, meaning that num is not 5, so it is redundant to check for non-5:
if num = 5
then do this
else if num != 5
do that
Instead, simplify to this:
if num = 5
then do this
else do that
And following the check for x, don't code an else or elif at that point. If an x is entered, the code will break out of the loop at that point. If not, your remaining code will execute, so it does not need to be under an else.
I replaced a series of echos with a single cat command. When you have a lengthy menu or something to display, the single cat command is better than a bunch of echos, and easier to format also.
For your counting loops, you were not initializing the counter variable, and you don't want = for the while-loop condition. You want -lt and -gt so that the condition will be true from the get go and will remain true until your destination is reached.
x=0
while true
doecho "input a number (x to quit):"
read num1
# [ $num1 = x ] && break
if [ $num1 = x ] ; then
echo "Bye Bye"
break
fi
cat << !
----------------------
1) count upward from 0
2) count down to 0
----------------------
!
echo "Please select an option: \c"
read num2
if [ $num2 = 1 ] ; then
counter=0
while [ $counter -lt $num1 ]
do
counter=`expr $counter + 1`
echo $counter
done
else
counter=$num1
while [ $counter -gt 0 ]
do
echo $counter
counter=`expr $counter - 1`
done
fi
done