When the motherboard is touching the case where it shouldn't be, it is grounded. And will not turn on/randomly turn off when it is touching the case. All you need to do is find where it is touching, and lift it away/oput something non-conductive there.