I am guessing that the molecule in question is actually formamide. One way that one can notate the carbonyl group is to put the "O" in parentheses. The resonance structure of formamide, HC(O)NH2, with a formal negative charge on oxygen and a formal positive charge on nitrogen is a valid resonance structure, although its contribution to the overall structure is probably less than the resonance structure in which both O and N have a formal charge of zero. It does not violate the Lewis octet rule. This resonance structure explains the approximate planarity of most amide bonds, among other properties. One cannot move a hydrogen when one is drawing resonance structures.