In addition to diffing undefined variables $names and $names2 instead of the files you created (names.lst and names2.lst), there is a couple of syntax error: you need a space around square brackets to execute the conditional.
#! /bin/bash
find teste1 > names.lst
find teste1 > names2.lst
result=$(diff -y -W 72 names.lst names2.lst)
if [ $? -eq 0 ]
then
echo "files are the same"
else
echo "files are different"
echo "$result"
fi