The Internet of Things (IoT) comprises of a diverse network of homogeneous and heterogeneous nodes that can be accessed through network ubiquitously. In unattended environments, the IoT devices are prone to various attacks including ballot-stuffing, bad-mouthing, self-promotion, on-off, opportunistic behavior attacks, etc. The on-off attack is difficult to detect as nodes switch their behavior from normal to malicious alternatively. A trust management model is a tool to defend the IoT system against malicious activities and provide reliable data exchange. The majority of existing IoT trust management techniques are based on static reward and punishment values in pursuit of trust computation thereby allowing the misbehaving nodes to deliberately perform on-off attacks. Due to the static nature of awarding scores, these schemes fail to identify malicious nodes in certain cases. In this paper, a dynamic and distributed trust management scheme (DDTMS) is proposed where nodes can autonomously evaluate peer nodes' behavior and dynamically grant reward and penalty score. The proposed scheme successfully detects the on-off attack and isolates the misbehaving nodes thereby classifying them into three distinct categories based on their severity levels i.e. low, mild, and severe. Simulation-based performance evaluation shows improved performance of the proposed DDTMS against other state-of-the-art schemes thereby requiring less time and fewer interactions for successfully identifying malevolent behavior of compromised nodes.