How to use an IF statement in node.twig
According the Twig If documentation, you would do it like this:

{% if content.field_boolean == true %}
  &lt;div class="text"&gt;
   {{ content.body }}
  &lt;/div&gt;
{% else %}
  &lt;div class="img"&gt;
   {{ content.field_image }}
  &lt;/div&gt;
{% endif %}


You need to use content.[machine name] you can find the machine name of you fields in Manage Display of your content type. 

From my example. change content.field_boolean to the machine name of your boolean field. If your boolean field is called "cool" then replace it with content.field_cool

Remember to clear/flush the cache to see changes.