Im new, and I'm confused as to how to put a melody together. If I want to do something with the E major scale for example, does it matter on which note I start, and can I only use a few of the notes? I know question is weird. I think I want to use the different positions of any given scale. I'm just struggling.
You can use as many or as few of the notes of the scale as you like. You can even use notes that AREN'T in the scale, while still being firmly 'in E major'. A blues player might linger on G natural. A bebop jazzer might enjoy featuring B flat. It's wide open.
Don't try to create music from a set of rules. Work on reading music, on playing lots of existing pieces from notation. Or, if you insist on doing it the hard way, imitate recordings by ear. You'll soon discover a lot of possibilities. Wrap them in theory if that interests you, but that's the least essential part.
The best way for a beginner to write a melody, is to just try and sing a tune that you like the sound of noodle around, have fun, come up with something that sounds nice to you, perhaps play some chords and see if you can come up with a melody that sounds nice with it. Or hum a little tune to yourself, and if you like it, see if you can put some chords to it after. Now, it may well turn out that it used only notes from the major scale. Or, it might use all kinds of notes. The point is, it should sound like music. If you like music, and you play an instrument, you'll be able to put on a chord progression you like and come up with something that sounds good!
Then, afterwards, you work out what you came up with, and try and figure out why it sounds the way it does. In the modern day that's easy too, you don't even have to remember it, you can just record it on your phone.
Consciously choosing a scale and trying to come up with a melody using just the notes of that scale will likely produce something very inferior to actually trying to come up with some music.
In direct answer to your question, a melody can have as many or as few notes as you it has. There's a very popular jazz standard called "C jam blues". It's a melody as good as any, you can hum it as you walk along the street, you can sing it with the record, it can stick in your head.
Literally 2 notes.