you have a mid ATX tower for your case.
the m just means micro ATX.
either can fit but the full version usually has more features and your case will fit it.
heres a comparison with the i7-4790k and the Pentium G3258. The Pentium performs almost the same as the i7 while gaming when overclocked. https://www.youtube.com/watch?v=evXpqpNhu_Y