I'm not familiar with Allegro, but I do suggest you enclose each condition in parentheses in lines 9 and 11. This will ensure that the operators are called in correct order.
Thanks for the suggestion, how would this be done exactly as the following way gives an error on the "&&" -
1 2 3
if(mouse_x < XposMax) && (mouse_x > XposMin) //and if the mouse position is lower than 520pixels and higher than 320
{
if(mouse_y < YposMin) && (mouse_y > YposMin)